Post Reply 

Color of transparent pixels

Jun 30, 2012, 23:45
Post: #1
Color of transparent pixels
How can I control the color of transparent pixels?

I save my image in RGBA (Windows bitmap). The RGB value of the completely transparent areas always turn completely black, and I want to control the color myself.

It may seem pointless, as the color is transparent, but I am using the image elsewhere (for creating mipmaps) where there is interpolation between pixels. Interpolating between 0 and 1 in opacity gives 50%, but the RGB part of the interpolation will mix with black, giving a dark halo.
Find all posts by this user
Quote this message in a reply
Jul 1, 2012, 08:31
Post: #2
RE: Color of transparent pixels
(Jul 1, 2012 00:13)ofnuts Wrote:  When you save as PNG, the RGB values are kept. Saving as BMP doesn't work the same, so there may be a bug. However when I tried to circumvent the problem by saving as PNG then using ImageMagick's convert to convert the PNG to BMP, the resulting image was weird: what was transparent on the PNG appeared with the original colors on the BMP and vice-versa. So I wonder if the BMP format supports transparency in a predictable way.

Did you try to use PNG or TGA instead?

Aha, when saving a copy in PNG format, there is actually a checkbox where you can request the option "Save color values from transparent pixels". But I can't see that they are saved. At least not when I convert to bmp (using ImageMagick), they are not there.

If you display a BMP file with the default viewer in Windows or Ubuntu (Gwenview), you can see that all transparent areas have turned black. The BMP file format supports 32 bit data, with A, R, G and B. I think Gimp pre multiplies the color channels with the alpha when exporting?
Find all posts by this user
Quote this message in a reply
Jul 2, 2012, 08:21
Post: #3
RE: Color of transparent pixels
Thanks, now I understand much better how this works!
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  What is the best font and color combination to write on this? genebrecht 0 48 Dec 14, 2018 13:00
Last Post: genebrecht
  Increasing Color Bit Depth on Legacy files -- Does it have any immediate effect? EndWggn 2 165 Oct 29, 2018 17:41
Last Post: EndWggn
  Transparent Background Troubles sarahladdnewton 1 247 Aug 6, 2018 06:03
Last Post: paynekj
  Transparent Layer Changing To Black instead of White after Export JustAmanda123 2 3,521 Jul 28, 2018 17:06
Last Post: abajan
  "Resize" by moving pixels down AdelCraft 1 231 May 21, 2018 06:26
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS