I've tried all the swsflags options and figure the answer is no, but it can't hurt to ask just in case. For example: downsample from 1920x1080 to 960x540, then upsample back to 1080 using the neighbor flag to recreate a perfect copy of the original 1080 image. Neighbor comes very close but there seems to be some color shifting happening in the downsample. Can another filter accomplish this, or is it simply the nature of the beast that downsampling will never be perfect?

  • 1
    When you downsample, you lose some information. That can't be restored.
    – Gyan
    Oct 6, 2019 at 13:47

2 Answers 2


That violates the rules of information theory. Look into the work of Claude Shannon if you wish to understand why what you are asking is mathematically impossible.


The information on an image is not made of rubber, you can not shrink and expand an image that way.

Downsampling is re-sampling. Making new data out of the initial information. Normally it is based on an average.

One example.

I make a poll on how many times a week do people eat icecream in summer.

  • Jane 2
  • Jack 2
  • Sue 3
  • JohnTheIcecreamEater 7

The average is 3.5 icecreams per person... average.

If I tell you that the average of lemonade drinks on the same week is 2, you have no idea what the original values are. You do not know if there is a JaneLemonadeDrinker or not.

There is NO way to reconstruct the original data from an average, from a downsampled image.

There are some algorithms that can assume a bit of new data and invent it. But having the original data is way better for detailed information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.