我可以在 Mac OS X 中将图像从 CMYK 转换为 RGB 吗?

Pat*_*ney 10 colors preview images conversion macos

有没有办法使用预览或 Mac OS X 中内置的任何其他工具将 JPEG 从 CMYK 转换为 RGB?

我看到我可以Tools | Assign Profile… 从一长串选项中进行选择,包括通用 CMYK 配置文件,但没有 RGB 选项。

Pat*_*ney 18

我找到了三种方法来做到这一点。

  1. 使用ColorSync打开图像。
  2. 使用Apply ColorSync Profile to ImagesAutomator 中的操作。
  3. 使用sips(感谢 NSD)并提供--matchTo参数。我编写了一个 shell 脚本来使用通用 RGB 配置文件转换图像。

 

#!/bin/sh

if [ $# -lt 1 ]; then
    cat >&2 <<EOF
usage:
    $0 filename
    $0 source-file destination-file

    Converts an image to RGB color space. The first form manipulates
    the file in-place.
EOF
    exit 1
fi           

SOURCE_FILE=$1

if [ $# -lt 2 ]; then
    DESTINATION_FILE=$SOURCE_FILE
else
    DESTINATION_FILE=$2
fi

sips \
    --matchTo '/System/Library/ColorSync/Profiles/Generic RGB Profile.icc' \
    "$SOURCE_FILE" \
    --out "$DESTINATION_FILE"
Run Code Online (Sandbox Code Playgroud)