Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug with low opacity layer on transparent background?
#1
Hello everyone,

I've been using Gimp 2.8 for years and since 2.10, there are some behaviors I really don't get. I searched for hours on the net without finding solutions because I think I miss keywords.
It's really simple, I have three layers, from the top to the bottom :

- Random white text 
- Layer opacity 10 which is a glow aura of the text 
- Black background

When I switch the black background to a transparent, the aura is diminished to the final export (see attachment). Why? My low opacity layer is the same whatever the situation, it's not supposed to behave according to the layer below it.

It gave me a lot of headaches for a long time. This behavior is clearly different from previous version of Gimp. I let 2.10 to the side for a long time because it literally destroys a lot of projects and I suspected a bug, but now it's 2.10.30 and it's still there. In 2.8 and before, layer is a layer, that's all, it doesn't disappear or change because of what you did on another layer. I feel like a total dumbass but can't manage to find anyone talk about it.

Thank you everyone by advance!


Attached Files Thumbnail(s)
   
Reply
#2
What is the image precision used (menu Image > Precision) ?
How do you export the image ? PNG ? Please, give the export options you use.
How do you "test" the exported image (re-import it in Gimp, with another software) ?
Reply
#3
Works for me. In the white case, the low opacity ring is hard to see but it's there:

   
   

If you use a color-indexed format, the opacity of layers is "binary" (so thresholded around 50%)
.
Can you attach an XCF showing the problem?
Reply
#4
Hello guys,

I drop in attachment the little project in xcf.

What is the image precision used (menu Image > Precision) ? -> 8 bits Integer (to change this value doesn't seem to change anything)
How do you export the image ? PNG ? Please, give the export options you use. -> Default values (I try without option, different one, no change)
How do you "test" the exported image (re-import it in Gimp, with another software) ? Irfanview 

The thing is, anyway we can cleary see when I switch the background transparent <-> black in Gimp, it "changes" the above low opacity layer. So it doesn't seem to be an export problem.
Maybe a configuration in the software.

Ofnuts : I'm sorry I didn't get your example. For me, in the first image, the ring is clearly different than the one in the second image.


Attached Files
.xcf   test.xcf (Size: 25.15 KB / Downloads: 97)
Reply
#5
One thing I have learned over the years is to not trust my eyes. A white layer at 10% opacity is hardly visible on anything but a dark  background.

In the images below:
  • The image on the left is your XCF, just cropped a bit, with the dark background lade invisible. It was exported to PNG that way.
  • The image on the right is the PNG, loaded back in Gimp.
  • In both images I have set "Sample points". The first three are on the same pixel in both images. #4 is in a different location in each image so that we can make sure which image the dialog applies to. 
  •  The dialog in the middle is the "Sample points" dialog. It shows pixels values at the sample point in the current image (which is the one with the dark title bar).
In this image, the XCF is the active image

   

In this image, the PNG is the active image

   

You can check that the alpha value is the same in both images for the first three sample points (and tht the 4th point is at a different location, so you are not lookin,g tha the pointer dialog for the same image). So, as far as I can tell, the alpha is exported OK. In fact to be truly honest, I didn't crop you image with the Crop tool. I used Image ➤ Crop to content, knowing it would keep any non-fully transparent pixel in the calque layer, which it did since the first sample point has an opacity of 1 (the lowest it can get before being fully transparent).
Reply
#6
The issue you are facing is due to the use of the opacity slider without a layer underneath.
This is a normal behavior: layer opacity determines how the layer is blend with the backdrop, not the alpha channel of the layer. So, with no backdrop, you lose this information when you export.
The way to do what you want (obtain this grey color when your exported image is put on a black background):
on the "Calque" layer :
- set the opacity slider to 100%
- either use Levels (or Curves) to decrease the Channel Alpha.
(or use a layer mask and set it's value to some dark grey)
Reply
#7
(04-16-2022, 09:54 AM)tmanni Wrote: The issue you are facing is due to the use of the opacity slider without a layer underneath.
This is a normal behavior: layer opacity determines how the layer is blend with the backdrop, not the alpha channel of the layer. So, with no backdrop, you lose this information when you export.
The way to do what you want (obtain this grey color when your exported image is put on a black background):
on the "Calque" layer :
- set the opacity slider to 100%
- either use Levels (or Curves) to decrease the Channel Alpha.
(or use a layer mask and set it's value to some dark grey)

Hmmm. If I create an image with a single layer, fill it with black, set the opacity to 50% and export this to PNG  I get this

   

While if the opacity is 100% I get this:

   

So the opacity slider applies anyway because Gimp exports a composite view of all layers so the opacities are taken in account (unless you use the file-*-save API which exports a single layer, without  taking its opacity in account).

And assuming you are right, the easiest way to have the opacity taken in account is to add a transparent layer under, then Gimp has something to blend into.
Reply
#8
(04-13-2022, 11:32 AM)Tsuchimi22 Wrote: Hello everyone,

I've been using Gimp 2.8 for years and since 2.10, there are some behaviors I really don't get. I searched for hours on the net without finding solutions because I think I miss keywords.

It gave me a lot of headaches for a long time. This behavior is clearly different from previous version of Gimp. I let 2.10 to the side for a long time because it literally destroys a lot of projects and I suspected a bug, but now it's 2.10.30 and it's still there. In 2.8 and before, layer is a layer, that's all, it doesn't disappear or change because of what you did on another layer. I feel like a total dumbass but can't manage to find anyone talk about it.

This behavior did not change with GIMP 2.10, your desktop background or folder background on the other hand certainly did.
It's called "Contrast", and you feel that you don't see it because there is not enough contrast (for your eyes) to see it. Not enough contrast with the background of your software viewer, or the background of your Desktop/Directory-Folder for the thumbnail

Solutions:
  • Put that software-viewer in dark mode or take a look at the setting to see if it can shows transparency on a dark background instead of the usual chessboard alike grid.
  • Put down the brightness of your screen/monitor. Your screen might be too bright or not calibrated.
  • Change the background of your Desktop or background of the folder where you put that .png

Look below I did put your image test in a directory/folder, exported as PNG without the black background, thus it has transparency, I increased the thumbnail view to 400% of this Folder and changed the background of this very-folder and you can even see that the thumbnail made by my OS retains the correct transparency with that slight blur from your image test.

   

You can even check that your image has retain proper transparency on website like imgur https://imgur.com/a/FlHzrwY (it's your image from the .xcf without the black background)
   
Reply
#9
Thank you for your answers but.. I think there is a misunderstanding somewhere because we don't talk about the same thing.
What you describe and solutions you offer is not what I'm concern.

PixLab Wrote:This behavior did not change with GIMP 2.10

It did. There is a different philosophy of handling layer opacity between versions. I don't know if it's better or not, but what is certain is that it changes somehow.
I'll try to explain better. I redownload Gimp 2.8 to make the comparison.

Gimp 2.8

   

Here we have our 3 layers. In the middle, it's the famous "low opacity layer" at 60%.
On Gimp 2.8, whatever the state of the black background layer (visible or not), the render will be THE SAME on a dark background after I put it somewhere in PNG. I'm web developper (but not designer no kiding), so suppose it's a website where the background-color is black.

To be more precise of my work habits : to create some little logos, images with a little bit a stylization of this kind, I use to work on black background (because global graphics of my website tend towards grey/black). But when I finish, I delete the black background so it lefts transparent and I export it in PNG. But, I know that if I re-place it in on some black background (or not that's the point, I start from 100% black but in the final it could be a black gradient background, a white / black photo...), it will have the same result as I used to work on the software.

Gimp 2.10

   

This time, the same thing but with Gimp 2.10.
What bothers me and confuses me is this time, the render will DEPENDS ON the state of the black background layer (visible or not). Again, consider the final of the final is to put it in some black background on website. So here I'm totally wrong. I work with black background supposing it'll have the same aspect on black background when I'll export it in transparent. But it won't.

One important thing I notice when doing this comparison is this time : my layer in the middle need to be at 16% to match the aspect of the Gimp 2.8 version.
And I think the key is probably here ?

if I haven't gone completely crazy yet, we can clearly see a difference of behavior of the opacity tool in the final result between theses two versions of Gimp.
And I'd like to understand it properly to retrieve my habits or to change it if I have to change it.
Reply
#10
Gimp 2.10 defaults to a linear color mode, not present in Gimp 2.8

Either
(1) Change the shadow layer mode to legacy
or preferably
(2) Right -click context menu on the shadow layer. Right at the top is 'Composite Space' change that to RGB (perceptual)

   

Note: Linear mode prevents those nasty dark edges when blurring colours together. An explanation here: https://youtu.be/LKnqECcg6Gw
Reply


Forum Jump: