2

I have several images that I would like to strip the ColorSync profile from. Eventually, I would like to automate this in bash so I could easily process this on a file or folder from the contextual menu using an Automator service.

How do I strip a color profile from an image file using Terminal?

5

Use sips (scriptable image processing system) to remove an ICC color profile from an image file in El Capitan. sips does a ton of other stuff as well.

To remove the ColorSync ICC profile from an image:

sips -d profile --deleteColorManagementProperties <imagefile>

Example:

MyFILE="${HOME}/Pictures/RemoveMyColorSyncProfile.jpg";
sips -d profile --deleteColorManagementProperties "${MyFILE}";

It appears to support the following image types, but I'm basing this on the format image property key (see Options in the man page):

  • jpeg
  • tiff
  • png
  • gif
  • jp2
  • pict
  • bmp
  • qtif
  • psd
  • sgi
  • tga

See the man page for more info, or use sips -h for help to stdout.

1
  • I just tried the sips command on macOS 11.2.3 and it doesn't appear to be working. The profile is still there. – Rob N Apr 5 at 19:59
1

OP @Emeraldo's answer is on-target: you can use the sips (scriptable image processing system) terminal command to remove the color profile from a JPEG (or PNG) image. This is often necessary to get colors in an image produced with a graphics app to render correctly in a browser.

I will add that Apple provides a script that will do this for you without you having to open a terminal or remember the slightly non-trivial command syntax. In /System/Library/Scripts/ColorSync (/Library/Scripts/ColorSync on Catalina) is an AppleScript droplet, Remove.app. If you drop one or more image files on it, it removes the color profile(s). If you open the droplet with Script Editor, you'll find it runs a sips command, just as @Emeraldo described. The original question indicated a hope to automate the process in Automator; this script would be a great starting place for that (if its function as a droplet isn't already enough for the stated batch conversion task).

I don't know for how long this script has been available, but on my High Sierra system the app file has a 2012 creation data. The script itself has comment giving a 2009 date. So I suspect it's been around for a while. I wish I'd known about it years ago. I used to use a Dashboard widget called "PNG Pong" for this, but it's no long available. I learned about the droplet from a 2010 Adobe forum post: How to remove color profile from an image | Adobe Community (though the script's location has slightly changed since 2010).

0

After installing ImageMagick (preferably with HomeBrew), run this Terminal command:

convert in.jpg +profile "icc" out.jpg

where in.jpg is your source image and out.jpg is what you want to name your new image. This command strips the icc profile (but keeps all others) from in.jpg.

To see what profiles an image has, you can inspect an image with ImageMagick too:

identify -verbose in.jpg

The profiles are under the "Profiles:" section of the output string. Some common profiles are (your numbers may vary)

Profile-8bim: 40 bytes
Profile-exif: 1788 bytes
Profile-icc: 30240 bytes
Profile-iptc: 0 bytes
Profile-xmp: 2547 bytes

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .