Transparency color in sprites sometimes does not work

Started by Feijotikus, Mon 23/07/2012 21:09:20

Previous topic - Next topic

Feijotikus

Hello!!.

I've been making my first adventure game for the last three weeks and so often I've been having the same problem. When I import some sprites which have the background with exactly the magenta color (as exactly than all the other sprites in my game), sometimes the AGS uses the sprite without any transparency (it shows the magenta color when the game is run).

I have deffined the Default Sprite Import Transparency at the File-Preferences menú as Palette Index 0, witch has the magenta color selected. This problem does not happen with every sprite, most of them work well, but suddenly one doesn't and I don't really know what I am doing different than the other sprites.

I have searched in the forum for some similar problems and I didn't find anything so I hope I'm not being repetitive.

Thanks!

Khris

Try choosing the top left pixel as transparency setting in the import window (or another corner).
I never use the Palette index 0 option since I don't know or care how to put a specific color into a palette slot, at least not with the 16bit PNGs I'm using.

Andail

First of all, don't focus so much on the colour - as long as you use one colour in the background of your sprite, it will be rendered transparent when you import it.

* Make sure that the editor picks a pixel that actually has the transparency-colour (you can choose a corner, or from palette index). Don't use the "no transparent" option.
* Make sure the background colour is exactly one colour. You can check this by filling it (the paint bucket) with a completely different colour, like bright green (make sure you turn off anti-aliasing). It should fill perfectly all over your background area, otherwise there are subtle nuances, and these will look weird when imported.

Feijotikus

Quote from: Khris on Mon 23/07/2012 22:25:10
Try choosing the top left pixel as transparency setting in the import window (or another corner).
I never use the Palette index 0 option since I don't know or care how to put a specific color into a palette slot, at least not with the 16bit PNGs I'm using.

I started using the top left pixel as transparency setting but I changed it because I had the same problem. I'm using 32bit PNGs and you can put an specific color in a palett slot easily at the color menú (but I think that it would see useless if the transparency works propertly :D )

Quote from: Andail on Mon 23/07/2012 22:28:00
First of all, don't focus so much on the colour - as long as you use one colour in the background of your sprite, it will be rendered transparent when you import it.

* Make sure that the editor picks a pixel that actually has the transparency-colour (you can choose a corner, or from palette index). Don't use the "no transparent" option.
* Make sure the background colour is exactly one colour. You can check this by filling it (the paint bucket) with a completely different colour, like bright green (make sure you turn off anti-aliasing). It should fill perfectly all over your background area, otherwise there are subtle nuances, and these will look weird when imported.

I'm total sure that the background colour is exactly one colour (I painted the background a lot of times precisely in bright green XD). What is anti-aliasing and where can I turn it off?

Ghost

Paint the background with a "pen" tool instead of a "brush". A brush has soft edges (anti-aliasing) and will vary the colour, a pen will not (non-AA).
Or just use the fill bucket ;)

Khris

You're using 32bit PNGs?
AGS does support alpha channels, or "proper transparency".
1. Paint your sprites on a layer so that the background is actually transparent (indicated by the checkerboard pattern).
2. Set your game to 32bit.
3. When you import the sprite, confirm to use its alpha channel.

That way, you can have smooth edges, too.

Feijotikus

Quote from: Ghost on Tue 24/07/2012 08:18:14
Paint the background with a "pen" tool instead of a "brush". A brush has soft edges (anti-aliasing) and will vary the colour, a pen will not (non-AA).
Or just use the fill bucket ;)

I had not any soft edge, it was all completly magenta. I still don't know what the problem was but...

Quote from: Khris on Tue 24/07/2012 09:13:29
You're using 32bit PNGs?
AGS does support alpha channels, or "proper transparency".
1. Paint your sprites on a layer so that the background is actually transparent (indicated by the checkerboard pattern).
2. Set your game to 32bit.
3. When you import the sprite, confirm to use its alpha channel.

That way, you can have smooth edges, too.

... but saving with transparent background and using its alpha channel works, so, I can forget about the magenta (which was burning my eyes all the time :D)

Thanks all of you very much, problem solved!

Khris

Just for reference, one doesn't have to use magenta.
To use standard transparency, AGS will pick any color as background/transparent one, as long as one states the corner which AGS is supposed to pick it from.

SMF spam blocked by CleanTalk