Skip to the content.

Change Image Size

Back to OpenCV

https://en.wikipedia.org/wiki/Interpolation

Write a function that when passed a scaling factor, the function will resize the image accordingly. For example, if passed 2, the function would resize the image to 2x the original dimensions. When passed 0.5, the function would resize the image to 0.5x the original dimensions. You can shrink an image through selective column dropping. You can grow an image using interpolation (estimation). My solution uses a simple interpolation to do both growing and shrinking.

My Solution

Starting Image

image

Download Image

Example Solutions

Generated Images of Various Sizes

image

image