Google Answers Logo
View Question
 
Q: algorithm to zoom images ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: algorithm to zoom images
Category: Computers > Algorithms
Asked by: patrickdang-ga
List Price: $20.00
Posted: 15 Oct 2006 10:34 PDT
Expires: 14 Nov 2006 09:34 PST
Question ID: 773698
Could you pleased give me some information about algorithms to zoom
images? I need it for my project.
Thanks!
Answer  
Subject: Re: algorithm to zoom images
Answered By: maniac-ga on 15 Oct 2006 14:04 PDT
Rated:5 out of 5 stars
 
Hello Patrickdang,

There are several good algorithms and/or source code implementations
for image magnification. You did not specify any constraints (such as
fixed magnification steps, allowing unequal X/Y zoom, speed, gray
scale / color, or licenses), so I will give you several examples that
you can choose from. If you have additional constraints - please make
a clarification request so I can find a solution that more closely
fits your project.

At the low end, there are methods such as pixel replication or pixel
decimation (eliminating "chosen" pixels) to generate larger and
smaller images respectively. These are fast but generally introduce a
number of artifacts that are visible to the viewer.

Slightly more complex methods include image averaging or
interpolation. There is a good summary of interpolation at
  http://www.cambridgeincolour.com/tutorials/image-interpolation.htm
which has a number of images illustrating the differences in several methods.

More advanced methods are generally adaptive - attempting to detect
edges or other significant changes in an image to either speed up the
processing or to ensure the edges or other signficiant changes remain
sharp. The hq3x example below appears to be in this category.

For papers on these algorithms, I suggest
 - your local university library
 - the on line journals at IEEE or ACM (if a member)
 - a search at Citeseer (http://citeseer.ist.psu.edu/cs)

For implementations and other information, here are a few good references.

hq3x Magnification Filter
   http://www.hiend3d.com/hq3x.html
This is an interesting implementation of a fixed zoom (3x in this
case) solution. In brief, it examines the 8 adjacent pixels to each
pixel and based on the relative color difference to determine the mix
of colors to be used in the 9 destination pixels (the 3x zoom). There
is companion code for 2x and 4x zoom - if interested, I may be able to
suggest methods to adapt to other zoom factors.

Thumbnail.java
  http://schmidt.devlib.org/java/save-jpeg-thumbnail.html
An implementation in Java using built in capabilities of Java to
convert a larger image into a "thumbnail" size. Size of the input
image is "automatic", you can set the size of the thumbnail &
"quality" settings for the output file.

ImageMagick
  http://www.imagemagick.org/script/index.php
or
  http://www.imagemagick.org/api/resize.php
ImageMagick can do a lot more than zoom an image and is callable from
a number of languages (C, C++, Java, Perl, Python, etc.).

Zoom
  http://www.xmission.com/~legalize/zoom.html
Another general purpose package - includes support for several
different file formats and has complete source code (C).

Color Averaging
  http://www.compuphase.com/graphic/scale3.htm
Some commentary and source code describing methods to average colors
(a method used frequently in image resizing algorithms). You may want
to look at the other articles posted here that may be helpful as well
(e.g., on perception of colors or "Color Metric").

Geometric Scaling Tutorial
  http://www.cee.hw.ac.uk/hipr/html/scale.html
Part of the "Hypermedial Image Processing Reference" at
  http://www.cee.hw.ac.uk/hipr/html/hipr_top.html
Has several good links / images that illustrate the basic concepts and
the differences in results.
 
For additional references, try searches using phrases like
  source code image magnification
  algorithm image magnification
  image scale source code
  image zoom source code
  adaptive image interpolation algorithm
  [algorithm name] image description
  image processing tutorial

If any part of the answer is unclear or you need additional
information on some aspect of your question - please make a
clarification request. I would be glad to help.

Good luck with your project.
  --Maniac
patrickdang-ga rated this answer:5 out of 5 stars and gave an additional tip of: $15.00
Thank you very much for this answer! This is REALLY helpful to me!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy