Interpolation algorithms when downscaling

前端 未结 6 481
长发绾君心
长发绾君心 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:27

    Whether we're upscaling or downscaling, we need to determine (to some degree of accuracy) what the colour value at a point between two pixels will be.

    Lets take a single row of pixels:

    P     P     P     P     P     P     P     P     P
    

    and we upsample, we want to know the pixel values to use at the in-between points:

    P   P   P   P   P   P   P   P   P   P   P   P   P
    

    and when we downsample, we also want to know the pixels values to use at the in-between points:

    P       P       P       P       P       P       P
    

    (Of course, we want to do this in two dimensions rather than one, but it's the same principle.)

    So regardless, we need to interpolate to determine the right sample value. Depending on how accurate we want the results, there are different interpolation techniques. Ideally, we'd be properly resampling with all the maths involved... but even that is just interpolation done rigourously!

提交回复
热议问题