我很惊讶 I found Mathematica 给出的 True
对于以下代码(在带有 Mathematica 8.0.1 的 32 位 Windows XP 上):
Rasterize[Graphics[{RGBColor[0, 0, 0], Disk[]}]] ===
Rasterize[Graphics[{RGBColor[0, 0, 1/257], Disk[]}]]
Mathematica 渲染和导出为不同颜色的 RGB 颜色值的最小差异是多少?是否依赖机器?
最佳答案
我相信这种行为取决于机器,但我不知道它究竟如何取决于操作系统。在我的机器上,它评估为 True
仅当分母为 511
时.
n = 257;
While[(Rasterize[Graphics[{RGBColor[0, 0, 0], Disk[]}]] ===
Rasterize[Graphics[{RGBColor[0, 0, 1/n], Disk[]}]]) != True,
n++];
Print@n
Out[1]=511
n<511
的两个图像之间存在差异p1 = ImageData@Rasterize[Graphics[{RGBColor[0, 0, 0], Disk[]}]];
p2 = ImageData@Rasterize[Graphics[{RGBColor[0, 0, 1/257], Disk[]}]];
ArrayPlot[p1 - p2]
这种差异在
n=510
中一直保持不变并且等于 1/255
.Max[p2 - p1] === N[1/255]
Out[1]=True
关于wolfram-mathematica - Mathematica 渲染和导出为不同颜色的 RGB 颜色值的最小差异是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7780327/