【问题标题】:imagemagick: wrong color during conversion of png fileimagemagick:在转换 png 文件时颜色错误
【发布时间】:2016-04-30 18:49:46
【问题描述】:

我有一个original 图像,我只想调整它的大小,但是在调整大小的过程中,result 图像变得更红了。我尝试了很多参数,但没有一个有效。同样奇怪的是,在我本地的 ubuntu 上一切正常,问题只出现在 CentOs 服务器上;

这是我尝试过的:

convert fileForRedTest.png -background white -alpha remove fileForTest-result.png
convert fileForRedTest.png -colorspace RGB  fileForRedTest-result.png
convert fileForRedTest.png -define png:bit-depth=16 fileForRedTest-result.png
convert fileForRedTest.png -define png:bit-depth=16 -define png:color-type=6 fileForRedTest-result.png
convert fileForRedTest.png png32:fileForRedTest-result.png

【问题讨论】:

  • 您的本地服务器可能有不同版本的 Imagemagick。如果它是默认安装,它可能已经过时三年或更长时间,并且 Imagemagick 正在持续开发中。
  • 我更新了版本,但问题依旧

标签: colors centos imagemagick png rgb


【解决方案1】:

我没有足够的声望来添加评论。 在 Windows 上:IM 6.8.9 也造成了很多红色。升级到最新的 6.9.3 解决了这个问题。我会再看一下目标机器上的二进制文件。

【讨论】:

    【解决方案2】:

    有两个原因:

    1. 旧版本的 lib(这就是我得到不同结果的原因)
    2. 这个参数:-define png:exclude-chunk=all -strip

    【讨论】:

    • 根据documentation,“-strip”是“-define png:exclude-chunk=EXIF,iCCP,iTXt,sRGB,tEXt,zCCP,zTXt,date”的快捷方式,因此可能与您建议的“-define png:exclude-chunk=all”非常相似。我不知道同时指定两者有什么作用,但对我来说,仅“-strip”就可以解决颜色问题。
    猜你喜欢
    • 1970-01-01
    • 2011-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-04
    • 1970-01-01
    • 2013-08-17
    • 1970-01-01
    相关资源
    最近更新 更多