DSPRelated.com
Forums

Image resizing code

Started by Jon Harris December 17, 2003
For a GUI application, there is a need to take .BMP images and scale them by
an arbitrary amount, probably proportionally.  I know it can be done with a
simple pixel duplicate/skip algorithm, but how easy/hard is it to do this
with algorithms such as bi-linear and bi-cubic that you see in Photoshop?
One coder here seems to indicate that it is quite difficult, but it doesn't
seem too bad to me at first glance.

Are there any libraries or code available for this?  I'm working in C++.  Or
at least a detailed description of these algorithms?

What I'm after is e.g. the way MS Word displays a bitmapped image when you
zoom to say 90 or 110%.


Jon Harris wrote:

Maybe this would be some help..
 http://www.ferzkopp.net/~aschiffler/Software/SDL_gfx-2.0/index.html

It's designed to work with SDL
 http://www.libsdl.org

Regards
--
Adrian Hey

> For a GUI application, there is a need to take .BMP images and scale them > by > an arbitrary amount, probably proportionally. I know it can be done with > a simple pixel duplicate/skip algorithm, but how easy/hard is it to do > this with algorithms such as bi-linear and bi-cubic that you see in > Photoshop? One coder here seems to indicate that it is quite difficult, > but it doesn't seem too bad to me at first glance. > > Are there any libraries or code available for this? I'm working in C++. > Or at least a detailed description of these algorithms? > > What I'm after is e.g. the way MS Word displays a bitmapped image when you > zoom to say 90 or 110%.
Jon Harris wrote:
...
> Are there any libraries or code available for this? I'm working in C++. Or > at least a detailed description of these algorithms?
I guess you are looking for image interpolation algorithms. There is some stuff here (look for papers by Unser or Ichige): http://bigwww.epfl.ch/preprints/ Regards, Andor