ImageMagick抗锯齿

3

我正在尝试调整大小并填充一些图像,而不进行抗锯齿处理:

convert test.bmp -resize 200x200 -background white -gravity center -extent 200x200 -monochrome

但是我得到了抗锯齿效果(灰色像素),我尝试添加+antialias,但似乎没有起作用。

这应该可以吗?

Mick

在尝试缩放后进行修改。

这是原始图片: enter image description here

这是之后的图片:

convert cp10.bmp  -scale 200x200 -background white -gravity center -extent 200x200 test.bmp

enter image description here


看起来样品可能正常运行... - undefined
但是我得到了一个巨大的RGB文件,原始文件是索引色彩,只有1个图层。 - undefined
添加了-colors 2,它正常工作!干杯。 - undefined
1个回答

4
默认情况下,-resize会根据图像使用Mitchell或Lanczos滤镜进行调整大小。这些滤镜对大多数图像都很有效,但如果您不想要它们的平滑效果(比如,如果您正在缩放像素艺术),请尝试使用-scale而不是-resize,或选择其他滤镜(-scale使用-filter box)。例如,这里是pattern:checkerboard

enter image description here

使用-resize 64x64参数:

enter image description here

使用 -scale 64x64 参数:

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接