你可以使用ImageMagick的-profile
选项:
convert image.jpg -profile <adobe.icc> -profile <sRGB.icc> new_image.jpg
点击此处获取更多详细信息:http://www.imagemagick.org/Usage/formats/#color_profile。
你尝试过使用Little CMS吗?这个命令可以将具有特殊颜色配置文件(例如Adobe RGB 1998)的图像转换为没有颜色配置文件但有效颜色相同的图像:
jpgicc -q100 input.jpg output.jpg
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
对于我来说,使用Krita重新导出图像似乎足够好:
krita my_img.jpg --export --export-filename my_img_in_srgb.jpg
Krita是一款开源的Photoshop/Paint软件,具有(极其有限的)命令行界面。您可以使用以下命令进行安装:
sudo apt install krita
convert image.jpg -profile <adobe.icc> -profile <sRGB.icc> new_image.jpg
。 - Rafael Xavierconvert image.jpg -profile <sRGB.icc> new_image.jpg
命令,因为原有的颜色配置文件已嵌入到图片中。如果我先加入 Adobe RGB 配置文件,ImageMagick 会进行两次转换(如果我正确地理解了文档的话)。 - Henrik