Sprite Alpha. What am I doing wrong?

Hi all,

Im taking a break from XNA (booo) Uni work to do some more Java Gaming.

I’m trying to make a isomorphic turret-defence using Slick2D and I think that I may have just kneecapped myself while making my Sprites. I spent 2 days doing these, so I hope i’m wrong :smiley:

Now, in XNA, and I was sure in Java2D, you can say that a color, say Color(255,45,255), is a chroma-key mask color, and anything with that will get removed. So, I went ahead and made a load of sprites like this:

http://sphotos.ak.fbcdn.net/hphotos-ak-snc6/hs079.snc6/168923_485052471716_555931716_6565243_6028099_n.jpg

Now that i’ve modeled and rendered all these things, I downloaded slick again and got going … only to not be able to find a way of doing the above.

I realy dont want to re-render all of these things :smiley:

What am I doing wrong here?

Thanks guys,
Matt

You could just open the images in something like gimp and choose ‘Colour to Alpha’ to quickly make the pink into alpha.
Not sure if slick has a built in api to do this.

Please post a PNG image, not a JPG.

Maybe with some crafty code, it can be fixed.

I’ve tried fixing them in photoshop, with no luck.

Sorry, I uploaded the image to a facebook gallery, which seems to have swapped it to a jpg.

Here;

http://gameworks.ravensbridge.com/images/house.png

I need to re-work my rendering I think. The reason that I did it this way is because I want the ambient occlusion ‘shadows’ from the ground plain (also pink) so that once it’s tranceparrent I get just hte shadows, and not the pink.

However, now that I’ve had a think about it some more, I dont this that this would work as therea re gradients of pink that i would want to remove the pink from, just leaving the colored shadows.

I get the shadows and AND render an alpha chanel, because the ground plain needs to have ) alpha to receive the shadows, so I think I need to figure out a way to do this. I’ve tryed re-rendering onto a white ground plane, but with similar problems.

If there’s a code way of doing it, it would be great :slight_smile:
That way I can have my cake and eat it. I think I may have just made this way to complicated for myself.

Thanks for the help guys.

Hah, I found out why I’m having troubble removing the pink in Photoshop. When the oclusion renders, it includes 10% of the (pink) background into the resulting color - which is why I cant get rid of the damn stuff without loosing my other colors :smiley:

Cool, I can now manualy remove the pink mask in PS while keeping my shadows.

Can’t you just swap the pink to be ‘transparent’?

I would rather re-render it with proper alpha instead of this “mask” mess, and forget about this “great” technique in future. There is problem also with antialiasing, not just the ambient in pink areas. You would get poor result if processed somehow to obtain the alpha channel directly from the image.

Also I see slight irregularity in the antialiasing along the walls, was the image scaled?

* Nate squints
You see what? :smiley: