Gimp-Forum.net
Color level adjustment of Layer mask can lead to color distortion - bug ? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Color level adjustment of Layer mask can lead to color distortion - bug ? (/Thread-Color-level-adjustment-of-Layer-mask-can-lead-to-color-distortion-bug)

Pages: 1 2


Color level adjustment of Layer mask can lead to color distortion - bug ? - Grobe - 12-12-2023

Hi.

I'm puzzled by an example where level adjustments (extreme settings) can lead to the resulting in color saturation go to maximum.

So my first question: When applying color levels (High input < 6) on a layer mask, is it normal that the resulting output colors can become "scrambled" ?

Second question: Layer mask in general - Is it true that the layer mask can only - for each pixel - set a transparency between 0-100? Or is there exceptions from this that I haven't considered?

Because if the above questions have the answers "No" and then "Yes", then it seems I just found a bug in Gimp.  Can you have a look at this file (original colors in layers and resulting colors after layer mask) and tell me if this output is normal or if I should file a bug.


RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Ofnuts - 12-12-2023


  1. Can you post the picture with the mask "before" you piush it?
  2. There are globally three ways to represent channels in Gimp:
    • As a value in the [0.0 ... 1.0] interval (Pixel in the Pointer and Sample points dialogs). This is mathematically how thing work under the hood in 2.10)
    • As a percent [0% ... 100%] (RGB(%) in said dialogs), so 100% is the same as 1.0 in Pixel.
    • As a 8-bit channel value in the [0 ... 255]  range (RGB(0..255) in said dialogs) so 255 in the same as 100% in RGB(%) or 1.0 in Pixel.
  3. So your opacity is likely expressed in percent...

    To add to the fun the Pixel value is a linear scale, while the RGB values are "perceptual", so a "middle" gray (gray that has the same overall luminosity as a dense checkerboard) is .50 in Pixel, but 73% (RGB(%)) and 186(RGB(0..255))



RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Ofnuts - 12-12-2023

PS: strangely, your image works fine in 8-bit precision.


RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Grobe - 12-13-2023

(12-12-2023, 11:10 PM)Ofnuts Wrote:
  1. Can you post the picture with the mask "before" you piush it?

Yes.


RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Ofnuts - 12-13-2023

Weird...
  • If I use your "Before" image, and threshold the mask to 0.06 I get essentially the same mask as in your "impossible colors" picture, but the image looks good.
  • If I copy/paste that new mask to the mask of the bad picture, the picture is fixed
  • If I copy the mask of the bad picture and the mask of the good picture as layers in a new picture and compare them... more weirdness ensues. The masks look identical, so putting the top one in Difference mode should give a black image.... and it doesn't. And when I use the Pointer dialog to look at the mask values, these values are completely out of range. The values that should all be 0. <= x <= 1.0 (as they are in the mask if the good picture) are in the thousands range! Also, they appear quite random, and two adjacent pixels have very different values.
  • So my guess is that due to the out of range values in the mask, the code that computes the final color gets out of range colors and what is displayed is a bit random.
[attachment=10842]

So the next step is: what did you do to the mask? A simple thresholding doesn't produce invalid results.


RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Grobe - 12-15-2023

I don't have the full story of the image. I can see if I can find the source image (or similar) and see if I can make to reproduce the results. If I get this, I can try to describe how to reproduce.

Btw: somehow I'm not receiving any emails notifying of post at this forum, I check once a day normally.


RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Grobe - 12-15-2023

I found the original image of the generator. The problem is I don't manage to reproduce the issue by now.

However, I do have a theory about how this came to be. In order to get to a layer mask that resembles a grayscale copy of the original image, I use selection first, and then create the layer mask from selection. Therefore I suspect that I've forgotten to "select none" before further editing.

This is what I do have by now, not sure if it is useful by now.

Ok - cannot upload new atachment, the xcf files are too large.


RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Ofnuts - 12-15-2023

(12-15-2023, 07:27 PM)Grobe Wrote: I found the original image of the generator. The problem is I don't manage to reproduce the issue by now.

However, I do have a theory about how this came to be. In order to get to a layer mask that resembles a grayscale copy of the original image, I use selection first, and then create the layer mask from selection. Therefore I suspect that I've forgotten to "select none" before further editing.

This is what I do have by now, not sure if it is useful by now.

Ok - cannot upload new atachment, the xcf files are too large.

You can save the XCF with advanced compression (shrinks to around 1/3 of initial size).. The limit on XCF is 2MB and with the compression this should be enough?


RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Grobe - 12-16-2023

(12-15-2023, 08:47 PM)Ofnuts Wrote:
(12-15-2023, 07:27 PM)Grobe Wrote: I found the original image of the generator. The problem is I don't manage to reproduce the issue by now.

However, I do have a theory about how this came to be. In order to get to a layer mask that resembles a grayscale copy of the original image, I use selection first, and then create the layer mask from selection. Therefore I suspect that I've forgotten to "select none" before further editing.

This is what I do have by now, not sure if it is useful by now.

Ok - cannot upload new atachment, the xcf files are too large.

You can save the XCF with advanced compression (shrinks to around 1/3 of initial size).. The limit on XCF is 2MB and with the compression this should be enough?

Ok, so there is a 2MB limit. I've scaled the files down so to fit within that limit.


RE: Color level adjustment of Layer mask can lead to color distortion - bug ? - Grobe - 12-16-2023

Is it worth file a bug on this, or you think it is still to little information (no persistent way of create the bad xcf file) ?