From embedded profile to LAB to sRGB
Posted: 2014-04-09T01:15:36-07:00
Hi everyone,
for about two years I've tried to understand color management in general and ImageMagick's way of handling color systems, color spaces and icc profiles in particular. It's a bit like fighting the Lernaean Hydra monster of ancient Greek mythology -- once you've successfuly solved one problen, two new questions pop up...
So here's my most recent one: I've got a bunch of TIFF images in 16 bit ProPhoto RGB color space (with a corresponding embedded icc profile; they're actually slides scanned using a magazine scanner). Now I'd like to convert those images into the LAB colorspace (in order to perform some level manipulation in the L channel) and finally save them as sRGB JPEGs.
Finally I came up with something like
with prophotorgb.icc being the profile embedded in the TIFFs, which I previously extracted using
.
The results look reasonable -- when not performing any L manipulation, the output of this command looks visually identical to a direct conversion from input to output image by just calling
So does the above tapeworm command look reasonable to you?
I wonder if it makes sense to assign plain RGB as colorspace to the profile-stripped input images since their initially embedded ProPhoto RGB profile has a gamma of 1.8.
I also wonder if there is a way to circumvent extraction and stripping of the input image's embedded color profile (if I don't, I get [coce]convert.im6: color profile operates on another colorspace `icc' @ error/profile.c/ProfileImage/792.[/code].)
Thanks for sharing your thoughts --
Torsten
P.S. I'm on Debian Sid, so I'm currently stuck with IM 6.7.7. Or maybe I should try to install 6.8.x from Experimental?
for about two years I've tried to understand color management in general and ImageMagick's way of handling color systems, color spaces and icc profiles in particular. It's a bit like fighting the Lernaean Hydra monster of ancient Greek mythology -- once you've successfuly solved one problen, two new questions pop up...

So here's my most recent one: I've got a bunch of TIFF images in 16 bit ProPhoto RGB color space (with a corresponding embedded icc profile; they're actually slides scanned using a magazine scanner). Now I'd like to convert those images into the LAB colorspace (in order to perform some level manipulation in the L channel) and finally save them as sRGB JPEGs.
Finally I came up with something like
Code: Select all
convert input.tiff +profile 'icc,icm' -set colorspace RGB -colorspace LAB <do semthing in LAB, like -channel R -level 10%,90% +channel> -colorspace sRGB -profile prophotorgb.icc -profile RGB output.jpg
Code: Select all
convert input.tiff icc:prophotorgb.icc
The results look reasonable -- when not performing any L manipulation, the output of this command looks visually identical to a direct conversion from input to output image by just calling
Code: Select all
convert input.tiff -profile sRGB output.jpg
I wonder if it makes sense to assign plain RGB as colorspace to the profile-stripped input images since their initially embedded ProPhoto RGB profile has a gamma of 1.8.
I also wonder if there is a way to circumvent extraction and stripping of the input image's embedded color profile (if I don't, I get [coce]convert.im6: color profile operates on another colorspace `icc' @ error/profile.c/ProfileImage/792.[/code].)
Thanks for sharing your thoughts --
Torsten
P.S. I'm on Debian Sid, so I'm currently stuck with IM 6.7.7. Or maybe I should try to install 6.8.x from Experimental?