PDA

View Full Version : Problem:PNG-Semi-Transparency & Sub-Pixel-Movement



HeldOT
09-17-2010, 04:55 AM
Hello there,

I'm using PNGs with transparency in my Program. Als long as I keep them aligned with the pixel-Raster everything is just fine. But when I position something "off-pixel" (e.g. with a translation of 0.5) then I get artifacts at the areas where the Image contains semi-transparent-pixels (e.g. at the borders of visible objects). I'll attach some files where you can see what I mean.
Problem is, the objects shall be moved over the screen - and that as smooth as possible.

Is there any way to solve this problem?

NeXEkho
09-17-2010, 05:01 AM
Ideally you want the content of your image to extend 1px each way over the transparency border. What it's doing here is interpolating to the black around the image as well as interpolating the alpha to 0. If you've got an old version of PSP which lets you modify the alpha/RGB 100% seperately this is a piece of cake but PS's transparency handling is awful.

ZbuffeR
09-17-2010, 05:03 AM
NeXEkho : Come on, just use premultiplied alpha with one_minus_alpha,one blending.