Sprites, PNG and Alpha channel.
Miscellaneous Forums/General Discussion/Sprites, PNG and Alpha channel.
Not sure this is the right forum, so feel free to move/delete my post if necessary.
I'm trying to create sprites with an alpha mask and save it to a png. My sister owns photoshop 7.0 so she tried helping me out. We cant figure out how to save the alpha channel using png format in photoshop, the 'add alpha' checkbox in the save dialog is grayed, any help?
Also
I tried doing it using The Gimp. Now, i have been able to create and save my png using alpha channel (although i cant reproduce it, it wont let me draw directly in the alpha channel, and i dont remember the 1000 things i tried before it worked). My problem is, i have 10 other sprites that have to use the same alpha channel, anyone know how to copy the alpha from one picture to another using the gimp?
(I've tried looking in photoshop/gimp website but couldnt find any help, hence why i'm asking here cuz i suppose many of you use such tools with great mastery)
Thanks,
Smurftra
You probably have to create a `mask` for the RGB layer and paint the alpha data onto that mask (which is an alpha channel), so that you then get the option to save it with PNG.
You also have to promote the background into a layer. Go Layer -> New -> Layer Fro Background. Ensure you're working in RGB mode, rather than CMYK, too.
Neil
Easiest way is to create a new document in Photoshop, then create a new layer. Draw all your stuff onto the new layer (or layers), hide the background layer, save as PNG.
In Photoshop, try the 'Save for Web' option. That works well for me.
Well, none of this worked :)
AngelDaniel and Neilo: I had created a 4th channel, photoshop itself names it Alpha. I can save it as a BMP with Alpha, just not a PNG (More on this later)
GfK: That does work, but then i cant work the alpha channel in an easy way: I have to redraw my image with transparancy (lets say i have a line, i have to delete current line and redraw a line using % transparency). I want to be able to edit my alpha channel, save, look at how it affects in game, re-edit etc..
JoeGR: You helped me out alot, i found out i cant do this thanks to you :). from the normal save dialog, it offers me PNG. From the web dialog, it shows : PNG 8, PNG 24. So ya, PNG in photoshop is RGB only not RGBA.
So....
I have to use The Gimp. Anyone know how to copy the alpha channel from one picture to another picture?
JoeGR: You helped me out alot, i found out i cant do this thanks to you :). from the normal save dialog, it offers me PNG. From the web dialog, it shows : PNG 8, PNG 24. So ya, PNG in photoshop is RGB only not RGBA.
No, it's not, it's RGBA. In fact it even supports alpha in PNG8, IIRC, though probably just 1 bit. Photoshop just exports the alpha in the way that GFK and Neilo described, and not in the way you wanted it to. And yes, Photoshop exports alpha to BMP in the way you want. So why not just export to bmp and use a command-line convertor to get your PNG from your BMP?
good idea Gabriel, any good free or cheap command-line convertor to recommend?
also, forgot to tell to everyone: thanks for your comments/time, much appreciated.
In Paint Shop Pro you can just mask what you want
and then copy the masked part. After that you paste
the clipboard into a new image and everything around
what you paste is transparent alpha. Works better than
a masked color bacause you get antialias against any
background.
Since Photoshop stole a lot of features from Paint Shop Pro
they probably nicked this feature too, hence it should work
for you in PS :o)
Wasn't there an alpha bug in Photoshop 7 that was fixed in something like Photshop 7.0.1 or 7.1? Anyone remember.
Why does alpha seem to be such a problem for paint packages? Really hacks me off. GIMP's Color to Alpha filter is very handly, but like Smurftra I'd just like to be able to edit the alpha channel directly (in a simpler way than GIMP - as far as I can tell you can only reduce alpha with the eraser - why can't I just draw a lower alpha on top?) - surely that's not too much to ask?
I have gimp too but can't figure out the advanced alpha stuff sorry...There are tutorals on the net apparently.
When using the 'Save to Web' option in Photoshop, select PNG 24 then (as I recall) there's a 'Transparency' checkbox just below that - make sure its checked.
Alpha is not a problem in Photoshop, you just have to know what you are doing.
The bug with .png in Photoshop was present in PS 6.0, and it is gone in CS. I think it was fixed in PS 6.01 so PS 7 should be fine. (the bug was that it output the wrong gamma settings for .png images.)
To properly export a transparent .png from photoshop, all you need is to have a document that has transparency. (you should see the background checkers in the transparent areas, but this may depend on your preference settings if you have changed things.)
Anyways, here are two simple ways to create a layer with transparency.
1. Start with a transparent layer and draw on it. you can use brush and eraser tools to get what you need.
2. Better method. Create a new layer and then create a layer mask for the layer. Now you can draw anything you want on the layer, and you can draw seperately on the mask to get the transparent effects you want. If you do not know what a layer mask is, do a search in the help. note: this is not the 4th channel you applied above,... it is in the layers pallette, not channels.
JoeGr: So if i save as 24, and check the alpha, it will save as 32? or will it somehow save the alpha in the 24 bits? (6x6x6x6?)
Pongo: I will try that.
Also, i'd rather have a solution using the gimp as it is free and bugging my sister so she does stuff for me in photoshop is a long process and annoying for her :)
And i dont own paint shop pro.
again, thanks all for the tips and suggestions
I believe that saving a png as 24 will actually save as 32. (24 bit color plus 8 bit alpha)
I should also let you know that I am currently making a blitz composite function that lets you mix multiple images with masks and different blending modes. I hope to post that here (including source) later this week.
Pongo, sounds interesting, just making sure i understand correctly:
Would i be able to select 10 (x) images, then tell it to add alpha from another image and save in format X (png, in my case)?