0

I have a very basic question about image downsampling. If I have an image that is of size 256 times 256 and I want to reduce it to size 128 times 128, is it completely safe to now take every alternate pixels? I am assuming that the new sampling position will fall precisely at the alternate pixel locations and there is no need to apply any interpolation kernel (as we will have a delta function at that kernel)?

Luca
  • 10,458
  • 24
  • 107
  • 234
  • Imagine an image that is a grid of lines 1 pixel wide spaced by 1 pixel... and the lines are in the rows and columns you remove... – Mark Setchell Oct 26 '14 at 16:44
  • Can you elaborate? I am not quite sure, I follow. – Luca Oct 26 '14 at 17:00
  • If you have a vertical line 1 pixel wide then a blank line 1 pixel wide then another vertical line 1 pixel wide and you remove every second line, you will end up with just the blank lines. – Mark Setchell Oct 26 '14 at 17:06

2 Answers2

2

No, not always completely safe:

enter image description here

This is a slightly tongue-in-cheek, extreme example because you asked if it was completely safe. In general, many applications use such a method for resampling and with any normal photo it will work fine.

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Thanks, that is quite an example. However, is that an exceptional case? I am guessing I should have a smoothing operator somehow before applying the interpolation then? Usually, if I just apply any interpolation, the way it will compute the indexes, it seems would do what you just described with this succinct example. – Luca Oct 26 '14 at 18:22
  • 1
    @Luca the effect is called aliasing and all practical algorithms show it to some extent. Your algorithm combined with this image is the worst case. You can see some examples at http://www.imagemagick.org/Usage/filter/ – Mark Ransom Oct 27 '14 at 01:58
0

Downsampling is a lossy operation. It all depends what objective you want to minimize. Natural images are smooth, so a gaussian kernel is an ideal choice. Generally, sampling alternate pixels would lead to high frequency artifacts in your down sampled image. In case you have images where you know that intensity of pairs like (i,i+1), (i+2, i+3) would be the same, then your strategy would be perfect for that kind of image. In other cases, it may not be the optimal thing to do.

Bharat
  • 2,139
  • 2
  • 16
  • 35