15

大きな写真からサムネイルと中サイズの画像を生成しています。これらの小さな写真は、オンラインギャラリーに表示するためのものです。写真家の多くは、 AdobeRGBを使用してJPEG画像を送信しています。一部のブラウザで「フラット」に表示されるように、サムネイルおよび中サイズの画像でsRGBを画像として使用できるかどうかを尋ねられました。

私は現在、ImageMagickを使用して小さいバージョンを作成しています。オプションがあり-colorspaceますが、それは私が望むことをしていないようです。

これを行う他の方法はありますか?また、これは価値があると思いますか?

4

4 に答える 4

9

Little CMSを試してみましたか? このコマンドは、特別なカラー プロファイル (Adobe RGB 1998 など) を持つ画像を、カラー プロファイルを持たない同じ有効色を持つ画像に変換します。

jpgicc -q100 input.jpg output.jpg

ここでは JPEG 品質を 100 に設定しています。

于 2012-05-29T20:54:43.730 に答える
3

ImageMagick フォーラムの次のスレッドでは、これについて詳細に議論しています: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=16464

私は現在、この bash スクリプトを使用して、任意の画像 (CMYK を含む) を sRGB に変換しています: http://alma.ch/scripts/any2srgb

プロファイルが埋め込まれていない画像には、icc プロファイルが必要です。これらはウェブ上で簡単に見つけることができます。たとえば、Adobe のサイト: http://www.adobe.com/cfusion/search/index.cfm?term=icc+profile&siteSection=support%3Adownloads

完全なスクリプトが行うことの要約 (未テスト) を次に示します (サイズ変更やその他のオプションは除きます)。プロファイルと ImageMagick が必要です。Debian ベースのシステムの場合: apt-get install icc-profiles imagemagick.

#!/bin/bash

srgb=sRGB.icm
cmyk=ISOwebcoated.icc

# extract possible color profile
profile="${f/%.*/.icc}"
convert "$f" "icc:$profile" 2>/dev/null

if cmp -s "$profile" "$srgb" ; then
    # embedded profile is already srgb. Nothing to do
    exit
fi

if [ -s "$profile" ]; then
    # we have an embedded profile, so ImageMagick will use that anyway
    convert "$f" -profile "$srgb" +profile '*' "$outfile"
else
    # no embedded profile in source
    if identify -format "%r" "$f" | grep -q CMYK; then
        # CMYK file without embedded profile
        convert "$f" -profile "$cmyk" -profile "$srgb" "$outfile"
    fi
fi
于 2012-02-02T16:14:31.527 に答える