Author Topic: Color management  (Read 4905 times)

Offline Nico

  • Newcomer
  • Posts: 5
Color management
« on: 2013 January 24 09:21:04 »
On the colorManagement screen you can specify the "default image profile". "RGBWWorking" gives you a control on the working space used by PI for color computations.

Am I right when I say that PI is using his own internal color space (controled by RGBWorkingSpace) for color processing, and the default color profiles is used only for loading/saving images to disk ?

In other words, can you tell me if there will be (color) differences in an images fully processed in PI, before to save it on the disk (in memory), if you process it with a sRgb default profile, or with a proPhotoRgb profile ?

Another question, did you see any advantages or constraints of using ProPhotoRgb over AdobeRgb as default profile for images processing coming from CCD ? (for Apn based images the choice is easier, because the gamut of modern Apns is very close to proPhotoRgb)

Thanks
Nicolas
Nicolas

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Color management
« Reply #1 on: 2013 January 25 12:03:27 »
Hi Nicolas,

Since this is an important topic, let me provide a bit of extended information on color spaces in PixInsight.

In PixInsight, color spaces used for color management and image processing tasks are completely independent:

- ICC color profiles are used for color management tasks, i.e. for consistency of color representation across devices and media. Each image can have its own embedded profile, or use the default global profile. A system-defined screen profile is used to characterize the chromatic response of the display. PixInsight is a color managed environment with full support of the ICC 4.3 specification, including support of V2 and V4 profiles and advanced soft proofing and gamut check functionality. Color management parameters and settings can be controlled with the global ColorManagementSetup tool. Color profile transformations and assignments can be done with the ICCProfileTransformation and AssignICCProfile tools, respectively. PixInsight's color management engine is based on the LittleCMS library.

- A colorimetrically defined RGB working space (RGBWS) is used for pure image processing tasks such as chrominance-luminance separations, color space transformations, saturation/hue transformations, color-based object detection, etc. Again, each image can have its own RGBWS defined or use the global RGBWS. The local (image-defined) and global RGBWS can be controlled with the RGBWorkingSpace tool.

- Note that this separate color system may change or become optional in a future version of PixInsight. However, such a radical change, if we finally decide to implement it, won't happen before version 2.0.

Quote
In other words, can you tell me if there will be (color) differences in an images fully processed in PI, before to save it on the disk (in memory), if you process it with a sRgb default profile, or with a proPhotoRgb profile ?

The use of different ICC profiles does not make any difference, by itself, in terms of the pixel data stored in the image. In other words, the numerical pixel sample values are not directly affected by the ICC profile assigned to the image, unless you perform a color space conversion (e.g. with the ICCProfileTransformation tool). This is a consequence of the separation between color management and image processing that I have described above. Note that this may not be true in other applications, where such separation does not exist.

However, since the Kodak ProPhoto color space has a much larger gamut than the sRGB space, your visual interpretation of the pixel data will be different, and this will probably induce you to apply less aggressive color saturation enhancements during your processing workflow. By "less aggressive" I mean transformations that assume a larger color space available when the pixel data are represented on the screen.

Make a simple test. Open in PixInsight a JPEG file downloaded from the web, or any color image without profile, or with the sRGB profile embedded. Now assign the ProPhoto profile to the image with the AssignICCProfile tool (or any other wide gamut space profile, such as Adobe RGB 1998). Apply a very strong saturation curve. Now assign the sRGB profile. The image is much less saturated, isn't it?

Quote
Another question, did you see any advantages or constraints of using ProPhotoRgb over AdobeRgb as default profile for images processing coming from CCD ? (for Apn based images the choice is easier, because the gamut of modern Apns is very close to proPhotoRgb)

Kodak ProPhoto is an extremely large color space. It includes more than a 90% of the existing colors in the CIE L*a*b* space. Adobe RGB 1998 includes about a 50% of CIE L*a*b*, so I think it is a much more realistic option. Anyway, as long as your workflow is consistent, there should be no problems with both spaces. Always remember that you *have* to convert your images to sRGB before deploying them to the WWW.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nico

  • Newcomer
  • Posts: 5
Re: Color management
« Reply #2 on: 2013 January 25 16:41:20 »
Hi Juan,

I'll need more time to re-read again and again your answer, thanks a lot, just a set of related questions.

I don't understand how the RGBWS can be totally independant from the profile of the image. sRgb and AdobeRgb are using D65 luminant. How can you compute a saturation if you are not using the same luminant ? To my understanding, but I can be wrong, you're the Jedi, not me :-) if you change the saturation of a color, you have to change the value of the color between the white and the full saturated color, then don't you need to use the same luminant. What did I miss here ??? Also why do you use D50 as default in the default RGBWS ?

I agree that using different icc profiles doesn't change the value of each color (with no transform), but it changes the gamut of the final image.

How large is RGBWS. Can it be compared to scRgb (ie same primaries as sRgb and broader range of possible values) ?

Thanks
Nicolas
Nicolas

Offline Philippe B.

  • PixInsight Old Hand
  • ****
  • Posts: 399
    • CIEL AUSTRAL
Re: Color management
« Reply #3 on: 2013 January 26 01:21:53 »
Nico, good luck
Next week at AIP Pixinsight conference/training, you will have to explain me (and the 94 trainers) what Juan said here   :cheesy: :cheesy: :cheesy: :cheesy:

lol

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Color management
« Reply #4 on: 2013 January 26 03:36:10 »
Hi Nicolas,

Quote
sRgb and AdobeRgb are using D65 luminant. How can you compute a saturation if you are not using the same luminant ?

Thanks to a process known as chromatic adaptation. PixInsight implements the Bradford chromatic adaptation algorithm.

Quote
Also why do you use D50 as default in the default RGBWS ?

Because it is the ICC standard illuminant, i.e. the illuminant used by all ICC profiles. For performance reasons, the whole platform must use the same illuminant, and D50 seemed the most logical choice when I was designing PI's color engine, back in 2003 (in the days of PixInsight LE).

Quote
I agree that using different icc profiles doesn't change the value of each color (with no transform), but it changes the gamut of the final image.

Note that the concept of color gamut refers to an a posteriori interpretation of the data, when the image has to be represented on physical media and devices, or if the image is going to be stored with limited numerical accuracy. You can embed any color profile of your choice in an image without altering its pixel values. Whether or not the embedded profile represents how the image is intended to be seen is another story, but the image itself does not change.

Quote
How large is RGBWS.

The RGBWS in PixInsight is a theoretical space not tied to any physical device. All RGBWS operations are performed using 64-bit floating point arithmetics and a careful implementation to minimize roundoff errors. You can think of the RGBWS as if it were an ideal monitor able to represent 1015 different hues for each color channel. That is certainly larger than the human vision's gamut :)

If you process your images in 32-bit floating point format (107 discrete pixel sample values), you'll never get any posterization caused by color space transformations or separations, in practice, irrespective of the RGBWS parameters or the color space of the profile associated with the image. 32-bit floating point is the recommended format for non-HDR and moderately large HDR images in PixInsight.

The ICC profile associated with the image is critical if you work in 8-bit integer format. With 8-bit images, there will be posterization if you work with large spaces such as ProPhoto, Adobe RGB, or Wide Gamut RGB. You can get some posterization in 8-bit images even in the sRGB space. Working in wide gamut spaces, posterization can also happen in 16-bit integer format if you apply aggressive saturation enhancements. However, who works with 8-bit or 16-bit images, actually? In case you really need them, you can work in the 32-bit integer or 64-bit floating point formats in PixInsight (232 and 1015 discrete pixel sample values, respectively), so this is not a practical problem.   

Quote
Can it be compared to scRgb (ie same primaries as sRgb and broader range of possible values) ?

The default RGBWS mimics the sRGB space in PixInsight. The only reason for this is that in this way the results of PixInsight's RGB-to-Grayscale conversions are the same as in most imaging applications, including all competing astronomical image processing applications. In other words, this has been a practical choice to avoid problems. For deep-sky astronomical image processing, a better default option would be a uniform space where the three luminance coefficients are equal to 1/3.

The purpose of a separate RGBWS in PixInsight is to provide the maximum possible flexibility to the users. The RGBWS is fully configurable for this reason. For example, if you want to work in a coherent environment, where image processing and color management tasks use the same color space, you can copy the parameters of your ICC profile space to the RGBWS (just make sure that you use values relative to D50). However, note that this will lead to luminance/chrominance separations where the relative weights of individual RGB channels will be unrelated, in general, to the information contents of the image. For everything related to color theory, conversion formulas and color space parameters, Bruce Lindbloom's website is an indispensable reference.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nico

  • Newcomer
  • Posts: 5
Re: Color management
« Reply #5 on: 2013 January 26 04:21:31 »
Juan

Thanks a lot for you answer

Another small remark, when you do a "reset" on the colorManagement Setup screen, pixInsight chooses the monitor display as the default profile, which is IMHO not the better default choice.

If I understand well what you're doing, the default behavior is to ease your work, and to do nothing on color managemen: because if the image has the monitor profile as his color space, no profileTransformation will be necessary to render it to the monitor. And because you're using another space for computation, it doesn't hurt, like it would in Photoshop.

The only issue is when you transfer your image to photoshop (or other), and keep the image profile, it will be not good at all. You're not helping the non-expert user here  :P

I hope to be able to explain all those details next week to Philippe (and other attendees)... If one time I can explain Philippe something that he doesn't know in pixInsight it would be a huge achievement...:tongue:
Nicolas
« Last Edit: 2013 January 26 06:52:11 by Nico »
Nicolas

Offline Philippe B.

  • PixInsight Old Hand
  • ****
  • Posts: 399
    • CIEL AUSTRAL
Re: Color management
« Reply #6 on: 2013 January 26 06:35:02 »
I hope to be able to explain all those things next week to Philippe (and other attendees)... If one time I can explain Philippe something that he doesn't know in pixInsight it would be a huge achievement... :tongue:
Nicolas

thanks, my friend !

Offline Nico

  • Newcomer
  • Posts: 5
Re: Color management
« Reply #7 on: 2013 January 26 07:19:36 »
Juan

Using 1/3,1/3,1/3 is not always the best choice, because the green layer often doesn't have so much luminance information in it, but I agree this choice is far better than using sRgb luminance info.

I read: http://pixinsight.com/doc/legacy/LE/14_color_spaces/why_rgbws/why_rgbws.html, can you tell us how did you find the best values for the luminance coefficients ? I'm sure there is no black magic here...

Thanks
Nicolas
Nicolas