12-06-2021, 04:16 PM (This post was last modified: 12-06-2021, 04:17 PM by david.)
I have created a small script which fills a transparent layer with a colour. If I carry out the procedure manually I get the correct colour, but when I do it in Python the colour is incorrect. The example detailed below the colour is D37518 Hex - 211, 117, 24 Decimal.
(12-06-2021, 04:16 PM)david Wrote: I have created a small script which fills a transparent layer with a colour. If I carry out the procedure manually I get the correct colour, but when I do it in Python the colour is incorrect. The example detailed below the colour is D37518 Hex - 211, 117, 24 Decimal.
12-06-2021, 07:32 PM (This post was last modified: 12-06-2021, 08:21 PM by david.)
I forgot to add to my original post: GIMP 2.10.28 running under ubuntu 20.04.
In case it is relevant I have attached the complete code. i just gave the one example, but the other four options with different colours are also incorrect.
(12-06-2021, 07:32 PM)david Wrote: I forgot to add to my original post: GIMP 2.10.28 running under ubuntu 20.04.
In case it is relevant I have attached the complete code. i just gave the one example, but the other four options with different colours are also incorrect.
I'm puzzled. I downloaded your script and to start with I was getting different values with the colour picker to those that were being set. I tried changing a few things and then could only get the correct values. I even deleted the version I had been playing with and re-downloaded the script - it still worked.
I am starting GIMP 2.10.28, creating a new RGB 8-bit image filled with the background colour of white. Image mode = RGB, precision = 8-bit with perceptual gamma (sRGB), colour management enabled. Then I run your script but have to make the lower two layer invisible before the picker gives the (expected) results.
12-07-2021, 11:40 AM (This post was last modified: 12-07-2021, 11:45 AM by david.)
Many thanks for the replies.
I have carried out more tests this morning. The results are absolutely consistent. I used RGB and Grey images (which are converted to RGB), 8 bit precision, but have tried up to 32 bit floating point with the same results. I measured the result after converting the layer mode from soft-light to normal.
With colour selected as white: FFFFFF 255,255,255
the measured result is: C5C5C5 197,197,197
With colour selected as red: FF0000 255,0,0
the measured result is: C50000 197,0,0
Similarly for green and blue.
With colour selected as grey: 7F7F7F 127,127,127
the measured result is: 616161 97,97,97
The result is consistently 0.77 (decimal) of the correct value.
Any suggestions for tests to resolve this problem are most welcome.
12-07-2021, 02:16 PM (This post was last modified: 12-07-2021, 02:32 PM by programmer_ceds.)
(12-07-2021, 11:40 AM)david Wrote: Many thanks for the replies.
I have carried out more tests this morning. The results are absolutely consistent. I used RGB and Grey images (which are converted to RGB), 8 bit precision, but have tried up to 32 bit floating point with the same results. I measured the result after converting the layer mode from soft-light to normal.
With colour selected as white: FFFFFF 255,255,255
the measured result is: C5C5C5 197,197,197
With colour selected as red: FF0000 255,0,0
the measured result is: C50000 197,0,0
Similarly for green and blue.
With colour selected as grey: 7F7F7F 127,127,127
the measured result is: 616161 97,97,97
The result is consistently 0.77 (decimal) of the correct value.
Any suggestions for tests to resolve this problem are most welcome.
Could you post the image that you are starting with - or if you are creating a new image the exact steps that you are using (including the settings under Advanced Options of the Create a New Image dialog?
Not doubting what you see, we just need to work out the difference between what you are doing and what Ofnuts and I are doing.
What settings do you have in Preferences/Colour Management?
12-07-2021, 02:41 PM (This post was last modified: 12-07-2021, 02:46 PM by david.)
programmer_ceds,
Thanks for the reply.
I am getting the same consistent results with all the photographs I have tried - jpg and tif format - recent and going back as far as 2009.
I have attached a typical picture. However, I had to scale it to get within the size limits set by the site, but I have confirmed that it gives the same result.
12-07-2021, 03:04 PM (This post was last modified: 12-07-2021, 03:05 PM by programmer_ceds.)
I still don't see a problem when I load your image (even with the colour management settings the same). Just to be clear, in order to get the colour-picker readings I am making the lower two layers invisible - just leaving the Tone layer.