Pixelation

General => General Discussion => Topic started by: mattib on June 26, 2012, 05:50:17 pm

Title: graphics gale exporting png issue
Post by: mattib on June 26, 2012, 05:50:17 pm
I have this different sprites that I want to put in flash.
The thing I do is export them as png, different image for each frame. I set the alpha channel. The problem is that, when I import them into flash, instead of the background color, the black that i use on the charachter gets erased.
what should i do? thanks
Title: Re: graphics gale exporting png issue
Post by: Pizza Tom on June 26, 2012, 07:41:55 pm
I had this same problem when importing some pixels into Unity. It didn't like my magenta as transparency, so I could either use black (which is usually what programs use for transparent) or nothing. :/

The only fix I found was to open it up in Photoshop and manually delete the pixels I wanted transparent with a 1 px eraser. Wish I had a more solid workaround, but at least you should be able to get it to work that way (I assume any similar program will also work if you don't have access to PS)
Title: Re: graphics gale exporting png issue
Post by: surt on June 26, 2012, 08:05:45 pm
In case you aren't aware, the image-level background colour isn't the transparent index. In GGale the transparent index is set per-frame in the frame properties.

If you already know that it could be that Flash/Unity ignore the index alpha entry in the PNG, it's possible that they just treat the first index as transparent, in which case you could just rearrange the palette to put the transparent colour at index 0.
Title: Re: graphics gale exporting png issue
Post by: mattib on June 27, 2012, 10:40:43 am
i think that it's the latter. How do I do that?
Title: Re: graphics gale exporting png issue
Post by: mattib on July 01, 2012, 04:05:18 pm
bump?
Title: Re: graphics gale exporting png issue
Post by: mattib on July 07, 2012, 08:21:39 pm
anyone?
Title: Re: graphics gale exporting png issue
Post by: ptoing on July 07, 2012, 08:45:50 pm
Google tells me that if you save the PNG as a 32bit one the alpha should be retained on import.
Ask Google and try what it tells you.
Google is your friend.
Title: Re: graphics gale exporting png issue
Post by: mattib on July 08, 2012, 01:11:22 pm
I am already searching on google but it's not that easy, I don't seem to find so many people with the same problem and often it isn't solved.
Nobody in this thread told me about the 32 bit thing, besides, when i save or export to png there are no options about the bits.

surt said this

" it's possible that they just treat the first index as transparent, in which case you could just rearrange the palette to put the transparent colour at index 0."

I just would like to know how to do this.
thanks
Title: Re: graphics gale exporting png issue
Post by: Kasumi on July 08, 2012, 02:03:04 pm
i think that it's the latter. How do I do that?
I know nothing about the specifics of this problem, but a free program called GrafX2 (http://code.google.com/p/grafx2/) can swap palette entries if that's the problem.

Download it, and open each frame image and use the xSwap function.

GrafX2 isn't necessarily the most intuitive, so here's some steps:

1. Click the L. Find your image with the image editor and open it.
2. Click pal.
3. Click, palette entry 0. An arrow will appear to the left of it.
4. Mess around slightly with the values to confirm it's the color that's being made transparent instead. (If not the problem is probably something else)
5. If so, Click X-Swap and click any other unused color in the palette.
6. Click layers, check background, color 0, and resave your image.

But none of that will probably help if flash doesn't like indexed png images. If that's the case irfanview (http://www.irfanview.com/) MAY help.

Open one of the images in question:
1. Image->Increase color depth. (If it's grayed out, this step is done. If it's not, you want 24bpp)
2. Save the image as png.
3. Check "Save transparent color" and try with and without "save transparency as Alpha Channel". (You probably want it with.) After you enter the filename, irfanview will let you click the color you want to be transparent.
4. Hope it works.
If it does, irfanview has some great batch processing which will allows you to do all these actions in one go. (Well, you'll still need to click the right transparent color for each image saved)

If neither of those things help, I don't know what to tell you since I don't own flash and can't really mess with it on my own.

But here's the link I think ptoing was referencing in case you haven't seen it: http://helpx.adobe.com/flash/kb/transparency-support-flash-professional.html

Edit: And it may be possible to do all this directly in graphics gale. It can create 24bpp images and has an option to make an alpha channel. But I'm not as familiar with it, so no steps from me on that. Also, I get the impression from your first post you already tried that.
Title: Re: graphics gale exporting png issue
Post by: PixelPiledriver on July 08, 2012, 02:30:07 pm
Got this to work:
(http://4.bp.blogspot.com/-LwpKH3lNn6c/T_mZCXz1FVI/AAAAAAAAB1g/EPfxZRn_Mv8/s1600/transparency_5.png)
(http://2.bp.blogspot.com/-GvKqbx3m0e4/T_mZDfNXgHI/AAAAAAAAB1o/qmmNd8YF26c/s1600/inFlash_1.png)

This is with Flash CS3.
Title: Re: graphics gale exporting png issue
Post by: mattib on July 08, 2012, 03:34:47 pm
yes!
thank you very much pixelpiledriver!
the process is really not so intuitive, even following your guide I had some troubles but in the end I managed to get what i wanted.
thank you everybody.