Black edges on smooth scaled sprites

Started by Junkface, Fri 12/09/2014 05:49:06

Previous topic - Next topic

Junkface

I'm toying with converting my game from 8-bit to 16-bit, largely for the sake of smooth scaled sprites, and am getting black edges around the sprites (as though fading to a black background):


Is this the result of not having an alpha channel and unavoidable, or am I doing something stupid?

Thanks.

Billbis

If you want to preserve the alpha channel, you should set up your game in 32 bits color depth.
Also, set transparency on "leave as is" when importing the sprite.
Cheers.

Junkface

Thanks, but, to clarify my question is in regards to the scaling AGS does itself (which if I'm reading the documentation correctly won't work with sprites that have an alpha channel). Is there a way to get this scaling to blend smoothly to the background, or am I stuck with dark edges?

Khris

#3
As far as I know, scaling has nothing to do with it. Semi-transparent pixels should scale along with the rest of the image and should not create colored edges (as long as game is 32bit & importing as alpha channeled sprite). Could you point to the part of the documentation where it says otherwise?
Otoh, interpolation might screw with the alpha channel. I don't know if I've ever tried scaling alpha channeled sprites...

Billbis

To be 100% honest, scaling sprites with alpha do add a very tiny darker outline on some parts, but is very subtle.
[imgzoom]http://image.noelshack.com/fichiers/2014/09/1393791754-lemasabachthani.png[/imgzoom]
Check the shoulders of the front character, for example.

Snarky

Quote from: Khris on Sat 13/09/2014 09:14:39
As far as I know, scaling has nothing to do with it. Semi-transparent pixels should scale along with the rest of the image and should not create colored edges (as long as game is 32bit & importing as alpha channeled sprite). Could you point to the part of the documentation where it says otherwise?
Otoh, interpolation might screw with the alpha channel. I don't know if I've ever tried scaling alpha channeled sprites...

I seem to recall that this was an issue with older versions of AGS, that you couldn't have both alpha-blending and smooth sprite scaling. But I'm 99% sure that it was fixed by CJ ages ago, like in version 2.7, or 3.0 at the latest. What version are you using, Junkface, and what documentation are you looking at?

Junkface

I'm using the 3.3.0 CustomRes version. In the help file under Alpha blended sprites it states
QuoteNOTE: Currently, alpha blended sprites cannot be antialiased, so if you have the Anti Alias Sprites option turned on in Setup, it will not be applied to alpha-blended characters.

After some more experimentation I think this is actually correct; when using a sprite with an alpha channel it seems to ignore the "Smooth scaled sprites" checkbox and it is scaled in a way that appears identical to how dynamic sprites are scaled. The alpha channel does seem to scale correctly, and I don't get any black outlines. I'm still not sure why the smooth-scaling/anti-aliasing seems to introduce black outlines, but switching to using 32-bit sprites and alpha channels instead is an easy solution.

Thanks for your help, everyone.

SMF spam blocked by CleanTalk