GNOME Bugzilla – Bug 86652
RGBA tga's, as rendered from blender lose alpha
Last modified: 2002-06-28 20:28:48 UTC
If I render an RGBA targa in blender, and open it in gimp (tested 1.2.2, 1.2.3 and 1.3.7), the alpha becomes black in gimp. "Could this be a blender problem?", you ask. I don't think so, because if I use ImageMagic (convert) to convert the targa to PNG, the PNG will open in gimp with alpha channel intact. Here is a sample tga which illustrates the problem: http://www.ualberta.ca/~cwant/blender/temp/alienmir1.tga Thanks, Chris Want
> "Could this be a blender problem?" The answer is: yes. Blender does not set the number of alpha bits correctly in the TGA header. This is a violation of the TGA specs. > I don't think so, because if I use ImageMagic (convert) to convert > the targa to PNG, the PNG will open in gimp with alpha channel > intact. But ImageMagic (convert) is wrong as well: it does not check the number of alpha bits and it relies only on the number of bits per pixel to decide if the image has transparency or not (this is wrong). This has been discussed in bug #65534. You could have found that easily by searching for "Blender" or for "TGA" in the bug query form. In summary, you should report this problem to the Blender developers and make sure that the problem is fixed in the next version (if there is any). *** This bug has been marked as a duplicate of 65534 ***
Hi Raphaël, My apologies for not searching first (the only search thing I saw wanted a bug number). Chris P.S. For anyone who wants a cheap and dirty workaround, here is a little perl script that will patch RGBA targas from blender to work in gimp: #!/usr/bin/perl # Fixes Blender's bad header for RGBA targa's # (changes the 18th byte from 0x00 to 0x08). # Usage: perl tgapatch.pl blenderfile.tga open(F, '+<', $ARGV[0]) or die "\nCant open $ARGV[0]: $!"; binmode(F); seek(F,17,0); print F chr(010); close(F) # end