OK I am getting a better hang of this. Let me see if I can summarize, please step up if you see something off (I am skipping the steps of calibration, CCM, white balance, etc.)
- An image in the standard sRGB color space has a tone response curve (TRC) applied to the (originally) linear light data. This has altered the stored RGB data values of the pixels. It stores the (originally linear) data more efficiently for human eye consumption.
Linear stage
- When working in a standard sRGB profile, and viewing linear data without any color profile assigned, the software assumes that the RGB data have the TRC of that working profile already baked in (they will be displayed wrong, but probably does not matter as much due to the extreme stretching that is coming up).
- To enable accurate display of the data, one could:
1. Assign a linear profile to the image at this linear stage (Siril recommends that). This will keep the RGB data intact, but the displayed colors will change (as the software now knows it's linear and will not try to undo a TRC curve).
2. Work in a linear color space for the imaging software - The software will then treat the untagged linear data as linear.
3. Have a square root preview enabled (in a standard sRGB working profile). This almost cancels out the assumption of the software that the data have the TRC sRGB baked into them.
Nonlinear stage
The purpose here is to i) apply the nonlinear stretches to visually enhance the image, as well as ii) the nonlinear transform of the (let's say sRGB) color space for exporting. Below are 3 example workflows, along with what I understand happens along the way.
A0. Start with image 1 above, i.e. linear data with an assigned linear profile in a standard sRGB working color space.
A1. Convert (not assign!) the color profile of the image with linear sRGB profile assigned (option 1 above) to standard sRGB. The RGB data will change (sRGB TRC), however the displayed colors will not change (the software knows the image has TRC).
A2. Stretches are applied (hopefully color preserving!). New RGB pixels values are written in the image, and what is displayed accurately represents the nonlinear image data. The stretches are applied to the TRC-encoded RGB values.
A3. sRGB Export. The final image should not change brightness or color, as it already has baked in the sRGB TRC and the software new about it.
Workflow A above always displays accurately but the stretches are applied on TRC-encoded data (less accurate).
B0. Start with linear data but unassigned color profile (sRGB working color space).
B1. Stretches are applied to the linear data. Displayed image is off, as the imaging software treats the data as TRC encoded.
B2. Manually (pixelmath) apply the sRGB TRC to the image data. This will alter the RGB values and bake in the sRGB TRC. The image appearance will change, but now (finally) the displayed colors will be accurate (the software was probably treating the data the same as its sRGB working space, but now the TRC has actually been applied).
B3. Export (along with an sRGB profile assignment).
Workflow B above applies the stretches in linear data (good) but the software thinks the data were TRC-encoded, and the stretches happen with inaccurate color display.
C0. Start with linear data in a linear sRGB working space (image could also be assigned a linear color profile)
C1. Stretches applied to the data. Displayed image is accurate.
C2. Convert the image's color profile from linear sRGB to standard sRGB. The pixel values are rewritten to bake in the TRC, but the displayed image does not change.
C4. Export (no change as the sRGB tag is already applies and the data are TRC encoded).
Workflow C seems the best? Stretches happen in linear space, and the display is always accurate.
I'm exhausted.