Clipped pixels

Moderator: jsachs

Charles2
Posts: 225
Joined: November 24th, 2009, 2:00 am
What is the make/model of your primary camera?: Fuji X-Pro 2
Contact:

Clipped pixels

Post by Charles2 »

Set Shadow clip at 0 in Preferences.
Color | Extract channel

Extracting red, green, and blue channels successively, the preview for a certain shot shows many clipped pixels, but the result shows few clipped pixels. Intended behavior?

And apparently, a pixel is clipped if any of R,G,B is 0.
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Clipped pixels

Post by tomczak »

I think that the reason may be that clipping warning operates on HSV-V channel: shadows clip when HSV-V=0, which also means that all three RGB channels for that pixel also need to be zero. There may be more shadow pixels in each of the RGB channels that are zero just in that channel, but non-zero in at least one of the two others.

With highlights clipping this is different as HSV-V=255 happens when any of RGB channels is maxed out, which indicates clipping in at least one RGB channel, not necessarily all three of them (which is great).

Both cases, shadow and highlights clipping done on HSV-V make a lot of practical sense to me: I care about single channel highlight clipping much more then single channel shadow blocking.

Here is an applet that can illustrate the relationship between HSV and RGB channels when they go to zero or max values:

http://colorizer.org/
Maciej Tomczak
Phototramp.com
Charles2
Posts: 225
Joined: November 24th, 2009, 2:00 am
What is the make/model of your primary camera?: Fuji X-Pro 2
Contact:

Re: Clipped pixels

Post by Charles2 »

tomczak wrote:I think that the reason may be that clipping warning operates on HSV-V channel: shadows clip when HSV-V=0, which also means that all three RGB channels for that pixel also need to be zero. There may be more shadow pixels in each of the RGB channels that are zero just in that channel, but non-zero in at least one of the two others.
I should make it clear that in this case the clipped pixels are in the shadows -- and the oddity is that many more are shown clipped in the preview window than in the result.
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Clipped pixels

Post by jsachs »

Sorry, the description of shadow clipping was incorrect. A shadow pixel is clipped only if the average of the three channels is less than the threshold - not when any individual channel is less than the threshold. It is normal for a single channel to be zero for images with very saturated dark colors. For highlights, a pixels is clipped if any channel is clipped.
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Clipped pixels

Post by tomczak »

So for a shadow pixel, if the threshold is set to the default zero, if any of the RGB channel values for this pixel is not zero, the pixels is not clipped?
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Clipped pixels

Post by jsachs »

Yes, although technically, the average can still be zero through round-off if the channels sum to 2 or less.

This can be changed if it makes more sense to clip on any channel being zero, but that's the way it works now. Shadow clipping on any channel being zero would clip any fully saturated color in the HSV color space, regardless of brightness, so this does not correspond to the normal concept of shadow clipping. The other option to clip shadows on HSV value (i.e. on the maximum of the 3 channels).
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Clipped pixels

Post by tomczak »

I think that the blocking warning for shadows as average of RGB works well as it is. Clipping shadows based on HSV-V may be even better, but I'm not sure which one is more practical. Blocking shadows as any RGB channel goes to the threshold value, may not be such a good idea, as Jonathan explained.

Trying to understand it better, I set shadow blocking threshold to pixel value=20 and run it on a test image that consist of 33 wedges - gray as well as a single R,G,B saturated colour (with a smooth gray gradient on top), each differing by 8 pixel value, to see what happens:

It seems to me that for fully saturated dark primary colours (which probably rarely happen in nature), the shadow clipping based on average will clip some more pixels than the straight HSV-V would (you could use Readout tool to see what clips). Neutral gray clips at V=20, as expected, but R,G,B saturated patches clip at 60 (since the other two channels are zero, the average is 20).
Attachments
2015-06-11_162318.png
2015-06-11_162318.png (5.06 KiB) Viewed 9257 times
2015-06-11_162259.png
2015-06-11_162259.png (4.44 KiB) Viewed 9255 times
Maciej Tomczak
Phototramp.com
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Clipped pixels

Post by tomczak »

Another nit-picking observation: if highlight clipping is set to 255, the pixels that are e.g. 255,0,0 (saturated bright red), clip, but the green and blue (0,255,0 and 0,0, 255) don't - the threshold need to be 254 and 253 for them to clip. Why?
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Clipped pixels

Post by jsachs »

Clipping is actually based on the data sent to the monitor and not the original image data, so it can be affected slightly by the choice of monitor profile. If you set monitor profile to None, it will clip accurately.
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Clipped pixels

Post by tomczak »

Thanks, it does.

p.s. To change Monitor Profile to None, I also needed to change On Startup to Ignore... otherwise it didn't budge.
Maciej Tomczak
Phototramp.com
Post Reply