【发布时间】:2011-11-28 09:09:39
【问题描述】:
我有真彩色的 image.png, palette.png(N 种颜色,其中 N>256)或文本文件,其中列出 RGB 调色板。 如何使用此调色板获取图片?
如果我使用 imagemagick:
convert image.png -remap palette.png remap_image.png
它不起作用。
convert image.png -map palette.png remap_image.png
质量很差。图像非常嘈杂。文件大小比以前大了。
GIMP 提供最佳质量:
Сonvert image to indexed color > use custom palette
但 GIMP 是 GUI。我需要在控制台中转换很多图像而不运行 gimp 和 X.org。
【问题讨论】:
-
“> 256”颜色的调色板没有意义 - 它将为每个像素使用 RGB = 没有调色板。如果您在 GIMP 中使用“索引颜色”,结果将不是真彩色,而是使用最多 (
-
是的,从 RGB 到调色板将独立设置。需要设置正确的颜色数量。
-
默认情况下,您的 -remap 命令将与 FloydSteinberg 一起抖动。如果您不希望这样,请将 -dither none 放在 -remap 前面。
标签: linux console imagemagick gimp