Author Topic: Transparency color in sprites sometimes does not work  (Read 400 times)  Share 


Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Transparency color in sprites sometimes does not work
« Reply #1 on: 23 Jul 2012, 22:25 »
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.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Andail

  • Global Moderator
  • Mittens Baronet
  • Cultured man of mystery
    • I can help with backgrounds
    •  
Re: Transparency color in sprites sometimes does not work
« Reply #2 on: 23 Jul 2012, 22:28 »
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.
Be vigilant, citizen!
Check out my GiP, The Samaritan Paradox
Also, check my blog at http://faravidinteractive.wordpress.com/

Re: Transparency color in sprites sometimes does not work
« Reply #3 on: 24 Jul 2012, 06:36 »
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.
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

  • Guest
Re: Transparency color in sprites sometimes does not work
« Reply #4 on: 24 Jul 2012, 08:18 »
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

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Transparency color in sprites sometimes does not work
« Reply #5 on: 24 Jul 2012, 09:13 »
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.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Re: Transparency color in sprites sometimes does not work
« Reply #6 on: 24 Jul 2012, 12:36 »
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...

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

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Transparency color in sprites sometimes does not work
« Reply #7 on: 24 Jul 2012, 17:05 »
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.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"