Author Topic: RGB Working spaces and ICC Profiles  (Read 7427 times)

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
RGB Working spaces and ICC Profiles
« on: 2010 January 21 04:24:21 »
Gents, looking for help here - as is Dave Halliday

OK, this is the 'sum total' of my knowledge

RGB Working Spaces
The main use for these is to define an equation that alllows us to extract the Lu data from an RGB image. Am I right?

It doesn't matter that the RGB image might actually have originated from, for example, Ha+Oiii+Sii individual data - it is now an RGB image. And that means that, at the very simplest interpretation Lu = (R + G + B) / 3. In other words the brightenss intensity of eaxh pixel value, on each colour plane, contributes with 'equal weight' to the brightness value of the same pixel in the Lu image.

Anything other than a 1:1:1 ratio will skew the effective contributions of each plane.

There are many predefined 'RGB Working Spaces', such as 'sRGB' - and I assume that these are just 'predefined' r:g:b 'scaling ratios' - but, now, I am out of my depth.

Why the various pre-defined RGBWorkingSpaces?
Why choose one, versus another, or indeed why deviate from 1:1:1 at all?

ICC Profiles
These are - in my mind - effectively just STF profiles that sit 'between' to processes. For example, an ICC profile that was linked to your monitor will 'modify' the way that the image is actually displayed, hopefully such that the colours you have so carefully created with your data are actually 'properly' represented on your monitor. Same goes for your printer, where the ICC profile takes the 'real' image data and massages it such that the printout matches what you see on-screen - which, of course, 'matches' what you actually have in the image file itself.

Question is, for example:-
I have 'self-calibrated' my monitor. I 'like' what I see on it. The colour-chart image that I uploaded elsewhere on the Forum, 'looks right' on screen.
And, I know that the colour chart is made from 'pure ADU values' - because that's how I built it in CorelDraw
But, if I send it 'to you', as a JPEG created by PixInsight, should I include, or not include, an ICC profile?
And, if I do include an ICC profile - which profile should it be?
And, if instead of emailing that image 'to you', what if I make it publicly available, as a JPEG, here on the Forum for example. What ICC profile should I use/or not use then?

And, why then if someone sends ME a JPEG image that they have worked hard on, which presumably 'looks right' on THEIR monitor, does that image 'look totally different' if I 'ChannelExtract' and then (immediately) ChannelCombine again?

Sorry Juan - this is the 'penalty' of being our 'Jedi' - can you help?  ::)

(and double apologies, but on reflection this may be better served as two separate threads)

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • PegasusAstronomy.com & Starshadows.com
Re: RGB Working spaces and ICC Profiles
« Reply #1 on: 2010 January 21 05:43:12 »
Several good questions
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: RGB Working spaces and ICC Profiles
« Reply #2 on: 2010 January 21 08:33:12 »
Hi Niall,

Your descriptions are correct. In PixInsight, separate color spaces are used for image processing and color management tasks:

- Each image defines a RGB working space (RGBWS). The RGBWS is used to perform luminance/chrominance separations. For example, when you enable one of those "To luminance" check boxes (in UnsharpMask for example), the luminance is calculated in the RGBWS of the target image. Or when you apply a S curve with CurvesTransformation, the image is first converted into a special HSVL space, the S component is altered, and the result is back converted to RGB. All of those conversions are performed in the target image's RGBWS.

- Each image has an associated (either embedded or not) ICC profile. An ICC profile defines a color space where the numerical pixel values of a given image are meaningful. An ICC profile can either characterize a physical device (camera, monitor, printer, scanner, etc.) in terms of chromatic response, or define a theoretical color space (Adobe RGB (1998), Apple RGB, Wide Gamut RGB, CIE RGB, etc.). In both cases, an ICC profile specifies how numerical pixel values must be interpreted in order to reproduce them correctly, for example in a physical device such as a printer, or to translate them into a different color space, for example when converting from a wide gamut space such as Adobe RGB to a limited gamut space such as sRGB. These operations is what we collectively know as color management.

The key point is that in PixInsight, RGBWSs and ICC profiles define separate, independent color spaces. RGBWSs are used for image processing and ICC profiles for color management, and there is no interrelation between them. By separating both tasks we gain in flexibility and efficiency (the divide and conquer strategy).

In other applications, however, ICC profiles are used to carry out luminance/chrominance separations involved in image processing tasks, and this is, IMO, a serious error. This is especially true for astronomical images, where color management oriented color spaces are far from optimal in terms of information representation, as we have discussed several times on this forum and other places.

Quote
Why the various pre-defined RGBWorkingSpaces?

The default RGBWS is sRGB because in this way PixInsight behaves as the vast majority of imaging applications out-of-the-box. Otherwise, lots and lots of people would have said "PixInsight's grayscale transformations are way wrong" and similar things for years :)

Quote
But, if I send it 'to you', as a JPEG created by PixInsight, should I include, or not include, an ICC profile?

The general answer to this question is yes. If you have calibrated your monitor, then you must be coherent with your calibrated environment throughout the entire imaging workflow. Color management works like a chain. If you break a single link, the entire system ceases to work completely.

The correct procedure would be:

- Select the correct ICC profile as the system monitor profile in your operating system. Mac OS X and Windows have integrated color management support. Linux/X11 does not, but PixInsight provides the lacking color management support on Linux.

- Be sure the correct monitor profile is selected when you open Edit > Color Management Setup. Note that on Windows and Mac OS X you cannot select a monitor profile in PixInsight. This is because PixInsight is not a color calibration system, and hence it doesn't try to supplant the functions of a color calibration system. The system monitor profile is selected automatically upon application startup.

- Normally you don't want to select your monitor profile as the default RGB profile. This is because your monitor profile isn't particularly good as a color space to represent your images (usually, all monitors except high-end ones emulate the sRGB space). The usual choice is to work just in sRGB, as it is the de facto standard for the web. This is the default option. Another option is to work into a wide gamut color space, such as Adobe RGB (1998) or ColorMatch RGB for example. In PixInsight, as we have RGBWSs for image processing, the default ICC profiles have no impact on luminance/chrominance separations, so their importance is marginal. In other applications though, this is an extremely important choice.

- When you save a version of your image for the web, convert it to the sRGB space if necessary, that is if you are using a different default RGB profile, or if your image has a different ICC profile embedded. Use the ICCProfileTransformation process for this task. Of course, do this with a duplicate of your image, as ICC profile transformations are irreversible. Make sure the sRGB profile is embedded in all your versions for the web. We must restrict ourselves to use sRGB for the web because unfortunately there are browsers out there without color management support (guess which one is a notable example: yes, IE). On the other hand, color management is disabled by default in Firefox, and only a marginal fraction of users are aware of FF's color management capabilities.

- When you save an image for other purposes, make sure that the file embeds the correct ICC profile. In this way if for example you send me your image, PixInsight will know how to render it on my monitor. Note that you must not embed your monitor profile, but the profile that describes your pixel data: either the default RGB ICC profile in your PixInsight installation, or the profile embedded (if there is one) in your working image.

The key point here is: each image file must embed an ICC profile that describes the actual meaning of the pixel values in the image.

Quote
And, why then if someone sends ME a JPEG image that they have worked hard on, which presumably 'looks right' on THEIR monitor, does that image 'look totally different' if I 'ChannelExtract' and then (immediately) ChannelCombine again?

Because (1) he/she probably didn't embed the correct ICC profile (usual case), and because (2) the correct ICC profile, if exists, is lost when you split and recombine individual RGB channels (the recombined image acquires the default RGB ICC profile in your PixInsight installation).

Quote
Sorry Juan - this is the 'penalty' of being our 'Jedi'

May the Force be with you  8)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: RGB Working spaces and ICC Profiles
« Reply #3 on: 2010 January 21 09:59:23 »
Several good answers

The force is strong in this one

(that  aside, now I just have to re-read Juan's (typically EXCELLENT) answer about 162.7 times, and it should start to make sense.
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline dhalliday

  • PixInsight Old Hand
  • ****
  • Posts: 307
    • on Flickr
Re: RGB Working spaces and ICC Profiles
« Reply #4 on: 2010 January 25 04:26:30 »
Niall
Your hair looks fine...
Now get out and party !!! >:D


Dave

Dave Halliday
8" Newtonian/Vixen VC200L/ TV 101,etc etc
SSAG/EQ6
CGE Pro
SBIG ST2K,ST10XME

Offline David Raphael

  • PixInsight Addict
  • ***
  • Posts: 226
    • Astrofactors CCD Cameras
Re: RGB Working spaces and ICC Profiles
« Reply #5 on: 2011 August 12 12:09:01 »
Juan - I read through this, and I noticed that on my OS X install - I can't choose sRGB at all...it looks like it only lists profiles that you've made specifically for your output device. 

Let me know if you know how I can explicitly use the sRGB space as an option.

Best,
Dave
David Raphael

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: RGB Working spaces and ICC Profiles
« Reply #6 on: 2011 August 15 10:56:25 »
Quote
on my OS X install - I can't choose sRGB at all...it looks like it only lists profiles that you've made specifically for your output device.

That's correct, you cannot associate a generic color space profile with a device (such as a monitor) on Mac OS X, but only profiles tagged for the device in question. I strongly disagree with these limitations 'designed to help you', but look, that's what the whole Mac is about --and that's why I only use Linux and FreeBSD :)

That said, you should be allowed to assign a generic color profile to an image. If sRGB doesn't appear in the list of available profiles when you try to select it with AssignICCProfile or ICCProfileTransformation, that's because the corresponding ICC profile file is not on your system. You can get the sRGB profiles from the standard Linux distributions of PixInsight (color/icc subdirectory).
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: RGB Working spaces and ICC Profiles
« Reply #7 on: 2011 August 15 15:02:14 »

That's correct, you cannot associate a generic color space profile with a device (such as a monitor) on Mac OS X, but only profiles tagged for the device in question. I strongly disagree with these limitations 'designed to help you', but look, that's what the whole Mac is about --and that's why I only use Linux and FreeBSD :)


whaaaat?


Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: RGB Working spaces and ICC Profiles
« Reply #8 on: 2011 August 16 06:20:16 »
I've been trying to figure out the grayscale working space to use.  I'm on Mac, and for PhotoShop I use Gray Gamma 2.2.  There doesn't seem to be many options for grayscale in the PI colour management options, yet mono imaging is quite common.  I'm wondering what everyone else uses for grayscale here?

PS - for colour I've always used ProPhotoRGB right through my working because of its wide gamut, then convert to sRGB right at the end just before web publishing. ProPhotoRGB matched my DSLR sensor's capability best, but while I haven't yet done testing for my QSI583, the initial results seem good to me.

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: RGB Working spaces and ICC Profiles
« Reply #9 on: 2011 August 16 07:53:34 »
A brief comment regards choice of color space for color management. A while ago I tried working in ProPhotoRGB and found that when converting to sRGB as a final step for web publishing that there were subtle changes in the image color and a small shift in the black point. I suspect this is due to the changes required to display the colors from the wider ProPhoto space to the smaller sRGB color space. Some of the colors available in ProPhoto aren't there in sRGB. If one is printing images then the ProPhoto color space makes sense, but if posting on the web is the primary goal then I've found that using the sRGB color space makes life easier.

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona