【发布时间】:2016-03-18 09:33:44
【问题描述】:
我正在渲染一个 mandelbrot 集,并且已经实现了一些平滑的着色,但是当仔细观察时,图片变得非常嘈杂。我想知道,改善我的色彩以获得更好的美学效果的最佳方法是什么。使用直方图着色是否有助于去除粗糙的像素化区域? Here is a render of the fractal using 10 000 iterations.
这就是我现在生成和分配颜色的方式:
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
int black = 0;
int[] colors = new int[max]; //max is the maximum number of iterations
for (int i = 0; i<max; i++) {
colors[i] = Color.HSBtoRGB(i/256f, 1, i/(i+8f));
}
for(int i = 0; i < colors.length / 2; i++)
{
int temp = colors[i];
colors[i] = colors[colors.length - i - 1];
colors[colors.length - i - 1] = temp;
}
...
...
...
if (iterations < max) image.setRGB(col, row, colors[iterations]);
else image.setRGB(col, row, black);
}
}
//ImageIO.write(image, "png", new File("mandelbrot_seeria90"+Integer.toString(i)+".png"));
ImageIO.write(image, "png", new File("resotest.png"));
【问题讨论】:
-
这里已经回答了这个问题:stackoverflow.com/a/1243788/216248
-
这个问题听起来不像是要求颜色的平滑插值,而是要求图像的“一般平滑”。这可能有点繁琐(你不能只使用一些高斯来模糊最终图像)。但是您可以对每个像素取迭代次数未超过的周围像素的平均值(即所有“非黑色”周围像素的平均值)
标签: java colors smooth fractals mandelbrot