Converting from AdobeRGB to sRGB using mogrify

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dws21

Converting from AdobeRGB to sRGB using mogrify

Post by dws21 »

I'm trying to convert in place from AdobeRGB JPGs with Mogrify using the following command line:

mogrify 1_aRGB.jpg -profile sRGB.icc

This updates the file but does not seem to do the conversion, looking with Inspect it still lists:

Profiles:
Profile-8bim: 8158 bytes
Profile-exif: 6751 bytes
Profile-icc: 560 bytes
Description: Adobe RGB (1998)
Manufacturer: Adobe RGB (1998)
Model: Adobe RGB (1998)
Copyright: Copyright 1999 Adobe Systems Incorporated

And visually when checked in a non-colour managed browser (IE8) it's still very obviously in AdobeRGB.

However I can get an image in sRGB by using Convert:

convert 1_aRGB.jpg -profile sRGB.icc sRGB_image.jpg

So am I using Mogrify correctly here, or is there a bug?

I am using: http://www.imagemagick.org/download/bin ... ws-dll.exe

Thanks!
Last edited by dws21 on 2010-06-21T05:05:06-07:00, edited 1 time in total.
dws21

Re: Converting from AdobeRGB to sRGB using mogrify does not

Post by dws21 »

Ah, it appears to work if you specify the same filename as the output:

mogrify 1_aRGB.jpg -profile sRGB.icc 1_aRGB.jpg

So without writing a script is there an easy way to get Mogrify to recurse a folder tree converting all images in it to sRGB?
dws21

Re: Converting from AdobeRGB to sRGB using mogrify does not

Post by dws21 »

I seem to be answering my own questions here. :)

A little more play and it seems that with Mogrify you need to specify the filename at the end, so for a simple batch file to Mogrify images to sRGB and recurse sub folders:

FOR /R %%a IN (*.jpg) DO mogrify -profile sRGB.icc "%%a"

Hope this helps someone else.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting from AdobeRGB to sRGB using mogrify

Post by snibgo »

Welcome to the forum. The act of formulating a question often helps us find the answer. I have a bunch of questions I have never posted for that reason.
snibgo's IM pages: im.snibgo.com
Post Reply