Saving with transparency

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

miracle
Posts: 3
Joined: Sat Nov 09, 2002 11:19 pm
Contact:

Saving with transparency

Postby miracle » Sat Nov 09, 2002 11:53 pm

I have a scene using spots with halos and stuff.
Now I'd like to get it into the gimp and put it onto some wallpaper in a way that the spot halos are still a little transparent, and so that the solid objects aren't.
If I put anything behind my scene inside blender (like a horizon blend, using the world buttons for example), the effect is just what I want - only I want to export the image and do the overlay somewhere else, and of course I don't want to import the wallpaper to blender, because then I'd have to think about lighting and perspective.
Is there a way to save an image (TGA/RGBA sounds quite good for a format) such that the transparency information against the non-existent background is just kept as an alpha-channel?
If not: Put this on the wishlist ;-)

Hos
Posts: 215
Joined: Wed Oct 16, 2002 12:06 am

Re: Saving with transparency

Postby Hos » Fri Nov 15, 2002 7:39 am

miracle wrote:I have a scene using spots with halos and stuff.
Now I'd like to get it into the gimp and put it onto some wallpaper in a way that the spot halos are still a little transparent, and so that the solid objects aren't.
If I put anything behind my scene inside blender (like a horizon blend, using the world buttons for example), the effect is just what I want - only I want to export the image and do the overlay somewhere else, and of course I don't want to import the wallpaper to blender, because then I'd have to think about lighting and perspective.
Is there a way to save an image (TGA/RGBA sounds quite good for a format) such that the transparency information against the non-existent background is just kept as an alpha-channel?
If not: Put this on the wishlist ;-)


There is a bug with the way blender writes it's RGBA targas
(it claims that the 32 bit targa has a 0 bit alpha channel).
This bug will be fixed soon. In the meantime, here is a
perl script that will fix your targas:

http://www.ualberta.ca/~cwant/blender/tgapatch.pl.txt

Regards,
Chris

Hos
Posts: 215
Joined: Wed Oct 16, 2002 12:06 am

Postby Hos » Fri Nov 15, 2002 10:11 pm

... or patch your own copy of blender:

RCS file: /usr/src/cvsroot/blender/source/blender/imbuf/intern/targa.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 targa.c
--- source/blender/imbuf/intern/targa.c 17 Oct 2002 05:40:35 -0000 1.1.1.1
+++ source/blender/imbuf/intern/targa.c 15 Nov 2002 21:03:56 -0000
@@ -284,6 +284,12 @@
buf[15] = ibuf->y >> 8;

if (flags & IB_ttob) buf[17] ^= 0x20;
+ /* Don't forget to indicate that your 32 bit
+ * targa uses 8 bits for the alpha channel!
+ */
+ if (ibuf->depth==32) {
+ buf[17] |= 0x08;
+ }

if (write(file, buf, 18) != 18) return (0);
if (ibuf->cmap){



Chris

miracle
Posts: 3
Joined: Sat Nov 09, 2002 11:19 pm
Contact:

Wow!

Postby miracle » Sat Nov 16, 2002 12:57 pm

Beautiful! Thanx a lot!

basse
Posts: 22
Joined: Tue Oct 15, 2002 11:10 pm

Postby basse » Sun Nov 17, 2002 11:25 pm

wow thanks Hos.. your patch really worked like a dream!

.b

DreadLORD
Posts: 1
Joined: Mon Feb 03, 2003 9:39 pm

Postby DreadLORD » Mon Feb 03, 2003 9:44 pm

Can someone explain to me how to use that patch (if possible)? It would help me out alot! Thanks!

--DreadLORD


Return to “Interface & Tools”

Who is online

Users browsing this forum: No registered users and 0 guests