IM7 sRGB v4 rendering intent

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?".
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

Embedded the v4 in the input image, this gives something that seems reasonable:

Code: Select all

~/ImageMagick/bin/magick -verbose INPUT.tif -colorspace RGB -filter Lanczos -resize WIDTHxHEIGHT -profile sRGB_v4_ICC_preference_displayclass.icc  OUTPUT.tif
P.S.
I'm starting to think that everybody's life will be much simpler if I stick to v2 profiles, and use the built-ins through -colorspace.
Last edited by NicolasRobidoux on 2012-04-16T19:47:03-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM7 sRGB v4 rendering intent

Post by fmw42 »

try imbedding the profile and then go back to your original command with two profiles and leave the final -strip off.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

fmw42 wrote:try imbedding the profile and then go back to your original command with two profiles and leave the final -strip off.
Sorry: I actually tried that and messed up reporting what I was doing.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

My student Adam Turcotte figured out how to make rawtherapee "know" sRGB v4:
Add the ICM (or ICC) profiles to /usr/share/color/icc (this is RawTherapee's default ICC path).
In RawTherapee, under the Color tab, goto Output Profile and it should show up.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

This is what I mean by the Point sanity check:

Code: Select all

~/ImageMagick/bin/magick footbridge.tif -filter Point -resize 2000x2000 -profile sRGB_v4_ICC_preference_displayclass.icc icc.tif
and

Code: Select all

~/ImageMagick/bin/magick footbridge.tif -filter Point -resize 2000x2000 plain.tif
should give almost the same images, because the only significant difference is going out and into sRGB v4 (in this test, the profile is embedded in footbridge.tif).
They do (I had incorrect comparison code earlier. Tired, so I make mistakes.) They give exactly the same images.

Now, if I replace Point by Lanczos, they still give exactly the same images. And they should not. Same if I don't embed the profile in the input file and use

Code: Select all

~/ImageMagick/bin/magick -verbose footbridge.tif -profile sRGB_v4_ICC_preference_displayclass.icc -filter Lanczos -resize 2000x2000 -profile sRGB_v4_ICC_preference_displayclass.icc icc.tif
Last edited by NicolasRobidoux on 2012-04-17T06:04:16-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

Tired or not, I did not expect this (this time, footbridge.tif has the v4 embedded):

Code: Select all

~/ImageMagick/bin/magick -verbose footbridge.tif -profile sRGB.icc sRGB.tif
footbridge.tif TIFF 840x840 840x840+0+0 16-bit TrueColor DirectClass 4.295MB 0.010u 0:00.010
magick: unable to open image `sRGB.icc': No such file or directory @ error/blob.c/OpenBlob/2608.
magick: unable to open file `sRGB.icc': No such file or directory @ error/blob.c/FileToBlob/941.
Same with sRGB.icm.
This is with the current svn IM7.
P.S.

Code: Select all

~/ImageMagick/bin/magick -verbose footbridge.tif -profile ~/ImageMagick/etc/ImageMagick/sRGB.icc sRGB.tif
footbridge.tif TIFF 840x840 840x840+0+0 16-bit TrueColor DirectClass 4.295MB 0.000u 0:00.000
/home/nicolas/ImageMagick/etc/ImageMagick/sRGB.icc ICC 1x1 1x1+0+0 16-bit DirectClass 6.92KB 0.000u 0:00.000
footbridge.tif=>sRGB.tif TIFF 840x840 840x840+0+0 16-bit TrueColor DirectClass 4.248MB 0.400u 0:00.339
P.S. It can't be that the sRGB.icc is not found because I'm doing a prefixed install, no?
P.S. I figured it out: -colorspace links to the built in sRGB profile, not -profile. But I think it's a bug.
Last edited by NicolasRobidoux on 2012-04-17T08:07:07-07:00, edited 2 times in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

I'll double check my tests tomorrow. Getting really temped to ditch sRGB v4.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM7 sRGB v4 rendering intent

Post by fmw42 »

NicolasRobidoux wrote:I'll double check my tests tomorrow. Getting really temped to ditch sRGB v4.
Does it even work reasonbly with v2? Just a sanity check to see if it is your profile or the command syntax.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

Some of my tests were probably done incorrectly. However, I do think that there is an IM7 bug: viewtopic.php?f=3&t=20782
Reverting to sRGB v2.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: IM7 sRGB v4 rendering intent

Post by anthony »

This is what happens as I understand it...

IM does not actually process the image data according to a ICC profile, unless you are migrating from one profile to another profile.

As such images containing profiles are (at least at this time) simply treated exactly like images without profiles, until you use a -profile!

Now, maybe this is not actually 'correct' handling.

Posible solution...

Images that are read with a ICC/ICM profile probably should be marked as having a colorspace of "profile".

That way when you do -colorspace RGB it first converts the colors from the 'profile' to RGB. Later when you do -colorspace 'Profile' it converts back to the colors as per the current profile (whatever that is at that moment).

In this scheme -profile to -profile conversion will ONLY happen if the -colorspace is currently set to 'profile'.

Also in this scheme a ICC profile is ONLY saved if the image is using colorspace 'profile', though I supose it could remain the users responsability to either remove or set the profile right if -colorspace is not set to 'profile' ???

Does this sound reasonable? It should solve quite a few problems, and looks to be mostly backward compatible. That is -profile to -profile conversion still works when it is appropriate, but it links better to the -colorspace image attribute.


Questions: How do profiles list image colors? In terms of XYZ coordinates? I have no idea about the mysterious internals of profiles. Perhaps I don't really need to know!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

The International Color Consortium Profile Format supports a variety of device-dependent and device-independent color spaces divided into three basic families: 1) CIEXYZ based, 2) RGB based, and 3) CMY based (including CMYK). A subset of the CIEXYZ based spaces are also defined as connection spaces.
(http://www.color.org/iccprofile.xalter)
@Anthony: It seems reasonable but I suspect it's a bad idea. To give you a solid reason why, I'd need to study more. Should I put learning more on my to do list?
I think that a good metaphor is to understand profiles as destructive means to "encode/decode" image values to and from a reference colourspace.

I'll need to think more about your proposal. Will do ASAP (but not today).
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

Actually, as I take the time to understand the consequences of what you propose, it seems more reasonable than I first thought.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

@Anthony: I think that my proposal viewtopic.php?f=2&t=20783 is not that different in spirit, but preserves more flexibility while remaining fairly transparent.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: IM7 sRGB v4 rendering intent

Post by anthony »

Not sure if I like the idea of a 'standard anchor space'. :-)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: IM7 sRGB v4 rendering intent

Post by NicolasRobidoux »

anthony wrote:Not sure if I like the idea of a 'standard anchor space'.
I thought about it, and if you want IM to do well with Q8, it makes things tricky :-(
Post Reply