Post Reply 

Black alpha destroys color information

Mar 24, 2011, 15:20
Post: #1
Black alpha destroys color information
I'm going to preface this by saying it has been a complete nightmare for me. I've spent hours searching for a solution to this problem and I'm at my wit's end, so sorry if I'm a little frustrated.

I have a texture for an object that will be rendered. The RGB for the texture contains diffuse color, and the Alpha channel contains a special parameter for the shader. The value for the parameter is 0 for 99% of the pixels.

In my XCF I have diffuse color on one layer, and the special parameter on another layer (as a greyscale).

So I copy the diffuse layer and call the copy Final. Then I create a layer mask on the parameter layer using the greyscale value. I copy the layer mask from the param layer to the Final layer, and then I apply the layer mask to Final, which should simply write the mask to alpha.

I look at the channels window to be sure, and alpha is written correctly, BUT everywhere that alpha is black THE OTHER THREE CHANNELS ARE ALSO BLACK! I can't fix this! What do I do? I even tried exporting to see if it carries through to the output image, and it does!

What's more, I tried to trick it by putting a very low value (like 1/2) in the pixels that are supposed to be 0 in alpha, and then I get an even weirder effect, wherein most of the color is kept, but some pixels color information is trashed anyway.

Sorry about the exclamation points. Is there an export mode which will tell GIMP not to trash the color information on fully transparent pixels? Or better yet, can I tell it that alpha is not transparency?
Find all posts by this user
Quote this message in a reply
Mar 24, 2011, 17:30
Post: #2
RE: Black alpha destroys color information
I think I did precisely what you described, and it worked.

But it still doesn't work on the original image.

I'm out until Tuesday, so I'll continue experimenting then.
Find all posts by this user
Quote this message in a reply
Mar 29, 2011, 11:55
Post: #3
RE: Black alpha destroys color information
And we're back!

So I genuinely can't figure this one out. I've attached two xcfs that reproduce the issue for me, Swirl Tile is a better example in general; The relief layer should be the alpha for the normal layer, and the specular layer should be the alpha for the albedo layer.

Then they get exported as two RGBA PNGs, but everywhere the alpha layer is black (on both) I get black color as well Sad

The method I use to produce the composite layer is as follows:

Choose the Specular layer ('Gloss' in Sandy Tile.xcf), right click -> Add Layer Mask -> Greyscale

Choose the Albedo Layer ('Diffuse' in Sandy Tile), right click -> Add Layer Mask -> White

Choose the specular layer mask, CTL+A CTL+C

choose the albedo layer mask, CTL+V, anchor floating layer

I've tried both 'apply layer mask' and just leaving the layer mask there when saving, both produce the same result.

When I save I make only the layer I want visible, and then 'Save A Copy' and so on...

The 'pointer' window tells me that there is color information even in transparent pixels, however the channels window tells me that there isn't... so that's strange and incongruous.


Attached File(s)
.xcf  Sandy Tile.xcf (Size: 1.02 MB / Downloads: 63)
.xcf  Swirl Tiles.xcf (Size: 403.44 KB / Downloads: 56)
Find all posts by this user
Quote this message in a reply
Mar 29, 2011, 12:14
Post: #4
RE: Black alpha destroys color information
AHA!

I figured it out. But it still doesn't make any sense.

If the image has more than one layer, even if the other layers are transparent or not visible, the exporter makes transparent pixels black.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Question Saving to a gif format and choosing the color palette SpongeBob 0 67 Dec 13, 2017 19:13
Last Post: SpongeBob
  Color filled letters Dan M 1 61 Dec 13, 2017 17:12
Last Post: paynekj
  not able to draw different color rectangles manish 1 92 Nov 3, 2017 04:01
Last Post: ythgilb
  Desaturate to color KWiK 2 186 Oct 9, 2017 22:14
Last Post: KWiK
  Removing color from multiple images Aquilo 3 3,096 Sep 28, 2017 12:56
Last Post: angel0sdh

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS