【问题标题】:How to identify if an image have an embed sRGB icc profile?如何识别图像是否具有嵌入的 sRGB icc 配置文件?
【发布时间】:2018-02-25 21:33:58
【问题描述】:

如果他们有 sRGB 配置文件,我想从我的图像中删除它们。问题我不知道如何识别图像具有 sRGB 配置文件。有什么好办法?

【问题讨论】:

    标签: image imagemagick imagick color-profile color-management


    【解决方案1】:

    在 Imagemagick 中,使用

    convert image.suffix -format "%[profiles]\n" info:
    

    或

    convert image.suffix -format "%[profile:icc]\n" info:
    

    除非您的 Imagemagick 版本过时。

    例如:

    convert logo.jpg  -format "%[profiles]\n" info:
    icc
    


    convert logo.jpg  -format "%[profile:icc]\n" info:
    sRGB built-in
    

    【讨论】:

    【解决方案2】:

    请不要接受这个答案,因为 Fred 已经向您展示了方法,但您可以通过 PHP Imagick 获取配置文件:

    $img = new Imagick('image.jpg');
    $img->setOption('format','%[profiles]');
    $img->setImageFilename('info:');
    
    $fd = fopen('php://memory','rwb');
    $img->writeImageFile($fd);
    fseek($fd, 0);
    $info = fread($fd, 1024);
    fclose($fd);
    var_dump($info);
    

    样本输出

    string(18) "app12,exif,icc,xmp"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-20
      • 2015-10-14
      • 1970-01-01
      • 2015-02-08
      • 1970-01-01
      • 1970-01-01
      • 2017-05-07
      • 2018-11-04
      相关资源
      最近更新 更多