Macos – convert an image from CMYK to RGB in Mac OS X

colorsconversionimagesmacospreview

Is there a way to convert a JPEG from CMYK to RGB, using Preview or any other tool built into Mac OS X?

I see I can go to Tools | Assign Profile… and select from a long list of options, including Generic CMYK Profile, but there's no RGB option.

Best Answer

I found three ways to do it.

  1. Open the image with ColorSync.
  2. Use the Apply ColorSync Profile to Images action in Automator.
  3. Use sips (thanks NSD) and supply the --matchTo argument. I wrote a shell script to convert an image using the Generic RGB Profile.

 

#!/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"
Related Question