1
\$\begingroup\$

Why does this border appear around the edges when I downscale a bitmap and how do I avoid it? I tried every filter I know, the results go from bad to worse.

Border problem

Here's the original bitmap:

original bitmap

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I do not think changing your sampling filter is going to fix this... is this a pre-multiplied alpha image? I suspect you are not properly dealing with that. \$\endgroup\$ Commented Jun 11, 2014 at 7:03

1 Answer 1

1
\$\begingroup\$

I don't know libgdx, but the problem is with your image. There are low opacity, white-ish pixels all around the edges of the Moon (ARGB is around (1, 255, 255, 255))

It's important to be aware of the fact that all pixels in an image have R, G and B values, even the ones where alpha is zero, and they might cause artifacts during sampling. There is a detailed article on this here: article.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .