optimize ImageData.perlinNoise and fix the usage of baseX, offsetX, etc