Amount sliders in Brightness curve transformation

Moderator: jsachs

Post Reply
pierrelabreche
Posts: 414
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Amount sliders in Brightness curve transformation

Post by pierrelabreche »

Looking at the "curve for areas where mask is black", the scale markers and readout value are complemented :
  • When the black marker is set to the leftmost position, the effect is 100% but the readout displays 0%.
  • I was expecting the 100% position of the black slider to be at the rightmost position.
... and vice-versa for the white markers and scale.
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Amount sliders in Brightness curve transformation

Post by jsachs »

The black slider controls how much of the transformation is applied where the mask is black. The white slider control how much of the transformation is applied where the mask is white. In their normal positions at 0% and 100%, the transformation is applied full strength where the mask is white and 0% where the mask is black. If you set them both at 100%, it is like not having a mask at all. See Controls.pdf under the Amount control for a description and examples.
Jonathan Sachs
Digital Light & Color
pierrelabreche
Posts: 414
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Amount sliders in Brightness curve transformation

Post by pierrelabreche »

jsachs wrote: November 21st, 2021, 6:21 pm The black slider controls how much of the transformation is applied where the mask is black. The white slider control how much of the transformation is applied where the mask is white. In their normal positions at 0% and 100%, the transformation is applied full strength where the mask is white and 0% where the mask is black. If you set them both at 100%, it is like not having a mask at all. See Controls.pdf under the Amount control for a description and examples.
I agree with those statements, but it is not how the specific curve is implemented in the Brightness curve tool ....

Using the screen capture for discussion.
Image

In PWP 8.0.250, the black marker must be set at 0% for effectiveness where the mask is black. This is contrary to PWP8's usual convention. I was expecting opposite marker positions for the Brighthess curve tool when selecting "curve for areas where mask is black". Thus black should be set to the far right for effectiveness in the black area of the mask. The value should read 100% when the black mask is fully effective.
Attachments
2021-11-21 sliders for Brighthess curve for areas where mask is black v1.jpg
2021-11-21 sliders for Brighthess curve for areas where mask is black v1.jpg (124.2 KiB) Viewed 2261 times
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Amount sliders in Brightness curve transformation

Post by jsachs »

Selecting the black curve button effectively inverts the mask so the sliders work the same way as when you select the white curve button. I think it would be more confusing the other way.
Jonathan Sachs
Digital Light & Color
pierrelabreche
Posts: 414
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Amount sliders in Brightness curve transformation

Post by pierrelabreche »

I was actually confused by the current interface : the black marker should control the black area with the value displayed at 100% when fully effective, not 0%. The suggested change would also be consistent with strength of a slider maximum to the right.
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Amount sliders in Brightness curve transformation

Post by jsachs »

I rewrote the description in the help file for the next release to hopefully clarify how this works.

One thing I think you are missing -- there is only one Amount control, not one for White and one for Black. Having two Amount controls would mean creating two separate masks. Thus reversing the sliders for the Black curve would also affect the White curve. The simple way to think of this is that when you select the Black curve, the mask is treated as inverted so it applies to the unselected parts of the image.
Jonathan Sachs
Digital Light & Color
pierrelabreche
Posts: 414
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Amount sliders in Brightness curve transformation

Post by pierrelabreche »

jsachs wrote: November 23rd, 2021, 7:45 am I rewrote the description in the help file for the next release to hopefully clarify how this works.

One thing I think you are missing -- there is only one Amount control, not one for White and one for Black. Having two Amount controls would mean creating two separate masks. Thus reversing the sliders for the Black curve would also affect the White curve. The simple way to think of this is that when you select the Black curve, the mask is treated as inverted so it applies to the unselected parts of the image.
You will find below a suggested interface for the brightness curve controls.
  • The black and the white curves are represented respectively to the left and to the right.
  • Each cursor also indicates two numbers representing the blending ratios for each curve.
  • The left number is the bending ratio for the black curve ; the right number is the blending ratio for the white curve.
2021-11-23 Suggested user interface for Brightness curve.jpg
2021-11-23 Suggested user interface for Brightness curve.jpg (61.13 KiB) Viewed 2202 times
pierrelabreche
Posts: 414
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Amount sliders in Brightness curve transformation

Post by pierrelabreche »

jsachs wrote: November 21st, 2021, 6:21 pm The black slider controls how much of the transformation is applied where the mask is black. The white slider control how much of the transformation is applied where the mask is white. In their normal positions at 0% and 100%, the transformation is applied full strength where the mask is white and 0% where the mask is black. If you set them both at 100%, it is like not having a mask at all. See Controls.pdf under the Amount control for a description and examples.
Based on observations, here is how I understand the slider with masking:
  • The black slider controls the blending of each brightness curve transformation where the mask is black.
  • The white slider controls the blending of each brightness curve transformation where the mask is white.
  • In their normal positions respectively at 0% ( black marker ) and 100% ( white marker ), the white curve transformation is applied full strength where the mask is white and the black curve transformation is applied full-strength where the mask is black.
  • If you set them both at 100%, it is like not having a mask at all, and the white curve is applied fully to the entire image.
  • If you set them both at 0%, it is like not having a mask at all, and the black curve is applied fully to the entire image.
  • Whenever you set them both at the same value, it is like not having a mask at all, and a blending of the two curves is applied to the entire image, with the selected ratio ( same value ).
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Amount sliders in Brightness curve transformation

Post by jsachs »

Here is how it works assuming you have a curve and no mask:

Apply the curve to the input image to produce image1
Blend the input image and image1 according to the Amount slider. At 0% you get the input image and at 100% you get image1
-------------------
Here is how it works now, assuming you have a mask and a white and black curve:

1) apply the white curve to the input image using the mask to produce image1
2) apply the black curve to the input image using an inverted mask to produce image2
3) Blend image1 and image 2 using the mask, producing image3 (the output image), i.e. use the mask to linearly interpolate between image1 and image 2, depending on the mask gray level.

Thus the white curve affects where the mask is white and the black curve affects where the mask is black. This is how it works now, assuming the black and white sliders are set at 0% and 100%.

In attempting to explain how it works with other settings, and in examining and testing the code, I realized I have never used it with anything but the default settings and that it does not actually behave consistently if you move the black and white sliders away from their default positions.

If there was just a single slider, it could blend the input image with image3 to produce the output image, and this would make some sense.

If there are both a black and a white slider, the situation is more complicated, but it could work as follows:

1) apply the white curve to the input image using the mask to produce image1
1a) blend the input image with image1 according to the mask and white slider to produce image1a
2) apply the black curve to the input image using an inverted mask to produce image2
2a) blend the input image with image2 according to the inverted mask and black slider to produce image2a
3) Blend image1a and image 2a using the mask, producing the output image

If it worked this way, you could use the black slider to modulate the effect of the black curve and the white slider to modulate the effect of the white curve, but the default would be both at 100% instead of black at 0% and white at 100%.

This is like what you were suggesting, namely that the black slider would be reversed from its normal setting so both sliders at 100% would give the full effect on both curves, but it would be different from the way the Amount control works in all other transformation. Also, reversing the sliders would not be the same as inverting the mask as it does in other transformations. On the other hand, unlike other transformations which only apply where the mask is white, this one applies to both where it is white and where it is black, so it is sort of consistent even if it is different.

Another possibility would be to have two Amount controls and two masks -- one for the black curve and one for the white curve, but I see a number of problems with this approach as well.

I need to think about this for a while before I decide how to handle the problem.
Jonathan Sachs
Digital Light & Color
pierrelabreche
Posts: 414
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Amount sliders in Brightness curve transformation

Post by pierrelabreche »

There are many good alternatives as you have explained.

The current behavior is workable, and would be intuitive with the afore suggested user interface.
In this implementation, blending uses only two images ( after white curve, after black curve ), rather than three ( input, white curve, black curve).
The markers just control the blending ratios of the two curves per this explanation :
1) apply the white curve to the input image, without mask, to produce image1w
2) apply the black curve to the input image, without mask, to produce image1b
3) The blending ratio between images 1w and 1b is controlled by the user-defined mask ( M1 ) and the position of the black and the white cursors.
4) Create a linear transformation for the mask. It is a linear brightness curve where the black point is mapped to the white allocation per the black marker, and the white point is set to the white allocation per the white marker.
5) Create a derived mask ( M2 ) by applying the above transformation to the user-defined mask M1. In M2, black identifies image1b and white identifies image1w.
3) Blend image1b and image1w using the mask M2, producing the output image


Another possibility is to make the user interface similar to the Two-zone adjustment:
1) apply the white curve to the input image produce image1w
2) apply the black curve to the input image to produce image1b
3) make a two-zone adjustment of images 1w and 1b, and instead of highlights and shadows, we have White mask and Black mask
Post Reply