嵌入图像色彩配置文件

不确定这是否在其他地方出现过(搜索词“嵌入的颜色配置文件”返回了不相关的结果.. :))。

我在 discuss.pixls.us 运营一个自由软件摄影论坛。正如您可能想象的那样,我们的用户对图像的显示方式非常挑剔。

最近我们在一个关于色彩管理的帖子中遇到了一个问题:

其中一位摄影师注意到,获取链接图像并本地存储的功能似乎会剥离图像中的颜色信息。虽然这对大多数论坛来说可能为了节省空间而可以接受,但对于摄影论坛来说,这确实令人有些头疼。:frowning:

举例来说,这张图片包含一个旋转的嵌入颜色配置文件。它 应该 显示为(Rot = 红,Grün = 绿,Blau = 蓝):


我在上面帖子中嵌入的源图像可以在这里找到:

https://houz.org/tmp/farbkreis.jpg

以下是同一张图片直接上传到论坛后的样子:

图像的处理是否使用了 ImageMagick?如果是,是否考虑过添加一个选项,在保存前将上传的图像转换为 sRGB 并为其打上相应标签?

(如果有人能指点我查看处理上传时图像转换的相关代码部分,我很乐意进一步调查。)

5 个赞

Sure check with @zogstrip.

@zogstrip - is the conversion being done using imagemagick? If so, would you mind pointing me to the relevant section?

It appears that we may only need an option to convert any images to sRGB if they have a different profile embedded, and then either strip the profile or specify that the image is now sRGB.

We do the resizing with convert but then the thumbnail is optimised using optipng.

You will find everything you need to know in OptimizedImage and more specifically

3 个赞

Tested fix:

https://github.com/discourse/discourse/pull/4064

3 个赞

This still does not look fixed to me… I just tried with the image on the OP.

@tgxworld as part of your image magick 7 upgrade can you test this?

3 个赞

This is actually a result of ImageOptim and not ImageMagick. We probably don’t want to be stripping the ICC profile here?

  • :strip — List of extra markers to strip: :comments , :exif , :iptc , :icc or :all (defaults to :all )
3 个赞

Probably :comments is what we want there?

1 个赞

I was thinking about this and this seems very specific to a photography forum. If they want to keep all the metadata/color profile, they can just set SiteSetting.strip_image_metadata to false. For majority of the images, keeping the exif or iptc metadata isn’t going to be very useful.

2 个赞

Interesting @Patrick_David, so this is not really a bug… it is a feature request to allow for fidelity when stripping exif tags (or simply misunderstanding an existing feature)

I am going to close this for now, but feel free to open a new topic if you find setting strip_image_metadata to false unacceptable.

5 个赞