画像に埋め込まれたカラープロファイル

どこか別の場所に投稿されたかどうかわかりません(検索語「color profile embedded」では関連しない結果しか返ってきません… :slight_smile: )。

私は 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