Editing alpha in 32 bit images.

BlitzMax Forums/BlitzMax Beginners Area/Editing alpha in 32 bit images.

Simon S(Posted 2005) [#1]
So I've played about with the samples in the Bmax folder and I see a few images do take advantage of alpha component, and i'd like to be able to use it too.

However for the life of me I can't find something that let's me edit the alpha layer. I have Paintshop Pro 8, and although when loading the png it does acknowledge the alpha layer (describing it as O for opacity I assume) but I cannot find anything to alter it on it's own. All the colour, layer stuff and help files doesn't mention anything better than 24 bit so I suspect PSP8 doesn't do alpha layers.

What programs do you guys use for altering the alpha layers of your images? I don't exactly have a fabulous budget so any cheap recommendations would be greatly appreciated.

Alternatively is there a stop gap solution in Bmax where a grayscale image could be combined with an existing 24 bit image to create an alpha'd image? Looks possible, if a little awkward and time consuming.


Perturbatio(Posted 2005) [#2]
the alpha layer in a png is a channel (as it is in most graphics apps), if you view the channels, you should have red, green, blue and another channel.

I use photoshop 6 and it does me fine.


Simon S(Posted 2005) [#3]
Yeah I thought it would be something like that but PSP8 only lists red, blue and green as valid channels in all the channel viewing/mixing options I could find.


Perturbatio(Posted 2005) [#4]
can you not create a channel in PSP?


Perturbatio(Posted 2005) [#5]
actually, having looked at it, Photoshop seems to handle transparent png's differently.
You have a base transparent layer and draw on that, then save it as a png, it automagically converts.

Maybe PSP does that too?


Simon S(Posted 2005) [#6]
You can create seperate greyscale images and combine them as channels, or seperate a full colour image into it's channels.

Unfortunatly it only seems to deal with the standards (RGB, HSV and CMYK).

The only thing in PSP that gives any hint about the images Alpha is the report from the colour picker.

Thought it's a relatively new program, I really don't think it deals with alpha, though I would love some PSP whizz to prove me wrong.

EDIT: Hmm, using a picked opaque colour or changing the opacity value of the drawing tool does alter the value of the O layer, but I've yet to find a way to do it without altering the existing RGB values. I'll experiment a bit more.


Perturbatio(Posted 2005) [#7]
If PSP supports layer, create a new image, make sure the only layer on it is transparent, draw something on it, save as png, and test it.

if you can't do alpha with psp, you definitely can with The GIMP.


Simon S(Posted 2005) [#8]
No success at all with PSP, but indeed the Gimp is very capable of dealing with transparency. Excellent.

Thanks for your help and patience Perturbatio.


Sledge(Posted 2005) [#9]
If PSP 8 is anything like PSP 7 then you need to look at the "Masks" menu. You should be able to load an alpha mask with the "Load from Alpha Channel" option, then click the "Edit" option and you will see that you have 256 shades of grey to paint the mask with.


AAM(Posted 2005) [#10]
PSP 8 will work fine. I had the same issue when I went to convert one of my images into an image with alpha parts.

In PSP 8 you have to set the Opacity value of the layer you want to be transparent AND save the image using the file optimizer. You set a layer's opacity by going to the General tab under Layer Properties (double-click the layer in the Layer toolbox pane) or goto Layers -> Properties.

Once you set the layer's opacity to the desired level, you have to use the file optimizer to correctly save the image with alpha values.

1. Go to File -> Save As...

2. Choose a desired filetype, GIF or PNG (PNG works best for transparency and BlitzMax).

3. Click the Options button in the Save As dialog box

4. Click the Run Optimizer button in the next dialog box

5. Click the Transparency tab in the next dialog box

6. Choose "Alpha channel transparency" and "Existing image or layer transparency" if not already selected. (you can choose the other options, if need be, to achieve a different result).

7. Click OK, then choose a new filename (or overwrite the existing one if already saved).

8. That's it. BlitzMax should correctly read the existing alpha values in the image and blend them appropriately with underlying pixels in the back buffer.

PSP may not be Photoshop, but you can definitely achieve a comparable result. More importantly, in regards to this thread, all that matters is that PSP can create images with alpha parts sufficiently without having to shell out the extra bucks for Photoshop. You can make any part of the image semi-transparent as you wish. Making a window pane with glass for example is perfectly and easily attainable with PSP. Hope this helps. Let me know if there are any questions. Enjoy!

- Aaron


Simon S(Posted 2005) [#11]
Gave it a go, and right enough you can indeed use opacity and save the png with an alpha layer. However it's still pretty awkward trying alter opacity without altering the RGB at the same time.

The Gimp does it well though, so I'm happy enough to draw in PSP and do any alpha alterations in the gimp.

Thanks for the advice everyone.