Sign up now! · Forgot password?
RSS/Atom feed Twitter

Strange behaviour with ALPHA in GIMP 2.8.10

This discussion is connected to the mailing list which is provided by the GIMP developers and not related to

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

Strange behaviour with ALPHA in GIMP 2.8.10 BDRB 06 Oct 23:04
2016-10-06 23:04:51 UTC (almost 3 years ago)
Send private message

Strange behaviour with ALPHA in GIMP 2.8.10

Hello All,

I'm having an issue with how alpha is treated by Gimp (and other programs). I first noticed this issue when I noticed that frames encoded into video look markedly different than frames "flattened" by gimp. I figured out how to reproduce images as they appear in the video (what I want), but I can't figure out why/how it works and where the difference is caused.

I would normally do the following to flatten an image (on a black background)

Method A 1. Load store-0056628.png (attached as Orig) 2. Set the background colour to black 3. Do Image -> Flatten Image

Method A results in image attached as A, which is far darker in appearance than it would be if encoded in a video file (using avconv).

I can reproduce the way the frame looks in video in Gimp by doing the following:

Method B 1. Load store-0056628.png
2. Go to Channels and unselect R, G, B channels (leaving only alpha selected) 3. Edit -> Fill with BG Colour

Method B results in image attached as B and is a very different image with much higher luminosity, and matches (identically as far as I can tell) the video encoded results.

Filling the alpha channel with a solid colour does not behave as I expect, as whether I fill with black or white makes no difference; the image is rendered with a black background in either case (I expect because the pixels with alpha=0 also have R,G,B=0). Black should make the whole image invisible, and white should make the whole image opaque.

Image viewers (such as Feh) and even using imagemagick to flatten the image lead to the same results as Method A.

What is Method B actually doing compared to Method A? Consistency with video is the goal, but it would be nice if I could figure out what is going on so I can use other programs (like Imagemagick) to do Method B. I presume I could use a video encoder to read PNGs and output PNGs, but that seems clunky.

Thanks, B.