Page 2 of 4

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-16T17:28:09-07:00
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.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-16T17:54:53-07:00
by fmw42
try imbedding the profile and then go back to your original command with two profiles and leave the final -strip off.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-16T18:02:40-07:00
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.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-16T18:46:13-07:00
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.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-16T18:56:21-07:00
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

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-16T20:07:00-07:00
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.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-16T20:12:01-07:00
by NicolasRobidoux
I'll double check my tests tomorrow. Getting really temped to ditch sRGB v4.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-16T20:27:22-07:00
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.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-17T08:23:58-07:00
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.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-17T17:11:48-07:00
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!

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-17T18:05:05-07:00
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).

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-17T18:09:14-07:00
by NicolasRobidoux
Actually, as I take the time to understand the consequences of what you propose, it seems more reasonable than I first thought.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-17T18:37:20-07:00
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.

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-17T21:13:34-07:00
by anthony
Not sure if I like the idea of a 'standard anchor space'. :-)

Re: IM7 sRGB v4 rendering intent

Posted: 2012-04-18T04:38:52-07:00
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 :-(