Interpolation algorithms when downscaling

前端 未结 6 458
长发绾君心
长发绾君心 2020-12-30 02:53

Im trying to understand downscaling. I can see how interpolation algorithms such as bicubic and nearest neighbour can be used when when upscaling, to \"fill in the blanks\"

6条回答
  •  有刺的猬
    2020-12-30 03:42

    Here you have the original image on top, then a naive removal algorithm in the middle, and an interpolating one at the bottom.

    Consider a big spotlight. The light at the center is the brightest, and the light at the edges become darker. When you shine it farther away, would you expect the light beam to suddenly lose the darkness near the edges and become a solid outline of light?

    No, and the same thing is happening here to the stackoverflow logo. As you can see in the first downscaling, the picture has lost the softness in its edges and looks horrible. The second downscaling has kept the smoothness at the edges by averaging the pixel surroundings.

    A simple convolution filter for you to try is to add the RGB values of the pixel and all other pixels surrounding it, and do a simple average. Then replace the pixel with that value. You can then discard the adjacent pixels since you've already included that information in the central pixel.

    alt text

提交回复
热议问题