How do I export+import PNG's properly?

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

8 5 0
Posts: 13
Joined: Tue Aug 21, 2007 12:24 am
Location: Atlanta

Post by 8 5 0 »

I figured out a work around.... but only for flat color images like this one. Use the alpha as a layer mask instead of the alpha channel. Here's the updated photoshop file. This should solve the problem the original poster had.

Unfortunately, this doesn't work for my project because I'm using images that are shaded and textured. So flattening the image on a solid color doesn't necessarily work for me. Could you explain a bit more on how you go about premultiplying your images?
Touched wrote:I always premultiply everything when I need to composite with an alpha channel. Usually, I'm premultiplying to black to match the black outlines of my characters, but for a file like this, where it's all a single colour, I just fill the entire main channel with the desired colour, and rely on the alpha channel to handle the shape.
User avatar
slowtiger
Posts: 6081
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Post by slowtiger »

Sorry, I get different results (PS 7 on Mac here).

I created a new file, and a new empty layer in it. I drew something on that layer. I switched off the background layer (checkerboard vsible).

I saved it the normal way as PNG, there was no option to click transparency or not.

I saved it a second time, this time "save for web" as would be my normal procedure to get transparency. This way I can control transparency and other issues.

Both images have transparency when imported to AS.
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched »

8 5 0 wrote:So flattening the image on a solid color doesn't necessarily work for me. Could you explain a bit more on how you go about premultiplying your images?
If you're asking me, unfortunately that's all I do, flatten my image onto a solid colour that matches the outline of my characters, or use the aforementioned filling entirely with a solid colour, but as I discovered tonight this method works on PNGs as far as Photoshop 5.5, but no further. Perhaps I could still do it in Photoshop CS2 if I save it as a TIFF or Targa with alpha channel, then convert it to PNG in another program which preserves the alpha channel, but I don't know offhand which programs will do that. I'm just going to keep a copy of PS 5.5 on hand.
8 5 0
Posts: 13
Joined: Tue Aug 21, 2007 12:24 am
Location: Atlanta

Post by 8 5 0 »

Thanks. I guess the pre-multiply thing doesn't matter much anyway since apparently PNG uses non-premultiplied alphas from the transparency... or whatever. I'm still reading up on it.

I'll have to check my photoshop file tomorrow at work. I must be doing something wrong. It's just strange that I can bring the same PNGs into After Effects without a problem.

Edit: Maybe it's something in Photoshop CS3, which is what I have at work... test now with Photoshop 7 creating test PNG files I don't seem to have problems.
Post Reply