PNG antialiasing bug?

Hello, I have this antialiasing problem when saving PNGs in Blender.

I am trying to make sprites for an isometric rpg. The goal is to have the sprite itself antialiased, but not its border with the transparent background. I believe I use all the right settings, even the result in Blender’s render window is as expected. The problem is when I save the image, somehow the border between solid and transparent pixels becomes antialiased.

If I don’t use any antialiasing, the border between solid and transparent pixels is not antialiased, even when saving the image. All in all this seems like a bug to me. Could anyone else perhaps test this? See the attached image for my rendering settings.

Attachments


There is no bug. This probably has something to do with the image viewer or other software that you’re using not having support for the Alpha channel in RGBA .png. I use RGBA .png all the time and I’ve never had any troubles with the format on any OS or editing/graphical software.

I don’t think I explained my problem clearly enough.

The left most example is what I get in blender’s render window. The centre is what I would expect the image to be, once saved on the disk. The right most example is the actual result. Zoom in and compare the transition between solid and transparent pixels for the centre and right example to see what I mean.

Attachments


PNGA saves an 8 bit Alpha channel so it allows smooth transitions between transparent and non-transparent parts. Normally that is what you want.
If you don’t then you have to either replace the alpha channel with an alpha mask afterwards in an image editor or save in a format that only allows an 1 bit alpha mask (targa maybe? gif is not supported.).
If you move the mouse in the render output window with the left mouse button pressed down you can see the alpha value.

Stupid me… you told that you switched antialias off. Works for me, looks like in your example then (i.e. like you want it to be).

if you want the middle image, turn off OSA. just click the button OSA to turn it off. OSA is Over Sampling/Aliasing, so if you dont want it, turn it off.

Well what I want is to have an antialiased sprite, but with 1 bit alpha mask. Turning off OSA does give me 1 bit alpha mask, but the sprite itself also lacks antialiasing, which is highly undesirable.

It seems that even though blender shows the render result as having 1 bit alpha (with OSA turned on), in reality it has 8-bit alpha (it simply doesn’t show it, though alpha values in the image editor confirm that some pixels are in fact semi-transparent). That’s why when the image is saved, I don’t get the expected result. A workaround is to save as RGB only and then delete the background in an image editor. The problem is, with so many sprites I might have to do in the future, such workflow is highly inefficient.

It looks to me that you turned on the Key option in the Render Panel. This creates the correct alpha channel and saves it alongside the RGB. What I think you want is Premul which makes the alpha channel and actually allows it to interact with the RGB, so a pixel halfway transparent looks that way.