首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GraphicsMagick -识别和删除附加的颜色配置文件

GraphicsMagick -识别和删除附加的颜色配置文件
EN

Stack Overflow用户
提问于 2015-08-14 14:09:25
回答 2查看 1.6K关注 0票数 0

我有一些带有嵌入式颜色配置文件(示例是Canon EOS-1Ds flash)的tiff图像。当我将它们转换为jpeg (gm convert source.tif target.jpeg)时,产生的jpeg颜色在浏览器(Chrome、Firefox,而不是IE)中会被扭曲,而在系统图像查看器中则不会。

如果我在GIMP中打开源代码,并将颜色配置文件更改为sRGB,那么上述转换命令中的图像将在浏览器中正确显示。

所以我有个问题:

如何识别图像具有嵌入的颜色配置文件这一事实?

使用此命令,配置文件将被移除:

代码语言:javascript
复制
mogrify +profile '*' -define jpeg:preserve-settings

这是gm identify -verbose source.tif的输出

代码语言:javascript
复制
Image: Di 2007-1337.tif
  Format: TIFF (Tagged Image File Format)
  Geometry: 4053x2257
  Class: DirectClass
  Type: true color
  Depth: 8 bits-per-pixel component
  Channel Depths:
    Red:      8 bits
    Green:    8 bits
    Blue:     8 bits
  Channel Statistics:
    Red:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                      135.75 (0.5324)
      Standard Deviation:         72.49 (0.2843)
    Green:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                      129.79 (0.5090)
      Standard Deviation:         72.87 (0.2858)
    Blue:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                      125.43 (0.4919)
      Standard Deviation:         73.42 (0.2879)
  Resolution: 400x400 pixels/inch
  Filesize: 26.4M
  Interlace: No
  Orientation: Unknown
  Background Color: white
  Border Color: #DFDFDF
  Matte Color: #BDBDBD
  Compose: Over
  Dispose: Undefined
  Iterations: 0
  Compression: No
  Signature: bec78e9402b39f6f5539a640715270a651a39c2238846fa42f37c1c7d99af747
  Profile-color: 219244 bytes
  Profile-iptc: 4358 bytes
    unknown:

    Byline:
  Rod 
    Source:
  Rod 
    Created Date:
  20061006
    Created Time:
  110014+0000
    Originating Program:
  Capture One PRO
    Program Version:
  3.7.1
    unknown:
  0x00000000: ffffff5c 2c3bff65 2dffff39 ffffff55 ff5bff27  ----\,;-e---9---U-[-
  0x00000014: ffffffff ff7affff ffffff48 103a29ff ff17ff58  '-----z-----H-:)----
  0x00000028: ff616363 3dffffff ffffffff ff777a63 6537ff19  X-acc=--------wzce7-
  0x0000003c: ffffffff 3c57ffff ff3c6674 ffff5f67 ff71ffff  -----<W---<
  0x00000050: 74ffff5f 67ff71ff ff00                        ft--_
  Tainted: False
  User Time: 0.030u
  Elapsed Time: 0:01
  Pixels Per Second: 290.8M

转换后的图像在OS图像查看器中也会被破坏:

代码语言:javascript
复制
  Format: TIFF (Tagged Image File Format)
  Geometry: 4992x3328
  Class: DirectClass
  Type: true color
  Depth: 8 bits-per-pixel component
  Channel Depths:
    Red:      8 bits
    Green:    8 bits
    Blue:     8 bits
  Channel Statistics:
    Red:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                      213.55 (0.8374)
      Standard Deviation:         57.03 (0.2237)
    Green:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                       40.76 (0.1598)
      Standard Deviation:         92.06 (0.3610)
    Blue:
      Minimum:                     0.00 (0.0000)
      Maximum:                   255.00 (1.0000)
      Mean:                      161.49 (0.6333)
      Standard Deviation:        121.23 (0.4754)
  Resolution: 300x300 pixels/inch
  Filesize: 47.6M
  Interlace: No
  Orientation: TopLeft
  Background Color: white
  Border Color: #DFDFDF
  Matte Color: #BDBDBD
  Compose: Over
  Dispose: Undefined
  Iterations: 0
  Compression: No
  Artist: Gary 
  Timestamp: 2006:11:12 12:35:12
  Make: Canon
  Model: Canon EOS-1Ds Mark II
  Software: Adobe Photoshop CS2 Macintosh
  Signature: 1b26f2c2122ea6aa391a40c7eb885d0da120x8e9x5bd7ce0dc7cc9038ba99737
  Profile-iptc: 12926 bytes
    unknown:

    Byline:
  Gary Ombler
    Originating Program:
  Capture One PRO
    Program Version:
  3.7.3
    unknown:
  #Q�$�'���߸︥�[��Rҝ5��n�b����h�
  Profile-XMP: 17293 bytes
  Tainted: False
  User Time: 0.140u
  Elapsed Time: 0:01
  Pixels Per Second: 45.3M
EN

回答 2

Stack Overflow用户

发布于 2015-10-08 04:26:16

代码语言:javascript
复制
gm identify -verbose *.tif | egrep -a '^Image|Profile-'

这将打印所有匹配的文件名,然后是具有它们的文件的配置文件。这至少可以让您一次扫描一个目录,并试图找出为什么某些文件是问题。

票数 1
EN

Stack Overflow用户

发布于 2022-05-08 08:35:44

也许您可以强制将着色空间强制到RGB:

代码语言:javascript
复制
gm convert +profile "*" -colorspace RGB source destination
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32012115

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档