views:

335

answers:

3

question says it all..

app would be in asp.net and c# (4.0)

+6  A: 

If you enlarge an image beyond its original size, you lose quality. There is no way around that.

That said, there are different methods/algorithms for resizing, some of which may introduce less quality degradation than others. Experiment with the resizing parameters to figure out which works best for your situation.

Dave Swersky
+8  A: 

This is impossible. Just think of the very simple case of a 10 x 10 bitmap with 8-bit color. Therefore there are 10 * 10 * 8 = 800 bits of information. Now try to enlarge this to a 100 x 100 bitmap with 8-bit color. This requires 80000 bits of information. Where is that extra information going to come from? There are all sorts of interpolation schemes for trying guess what the information should be but that's the best we can do. There must be a loss of quality as we don't know what the information should be.

Here are some interpolation schemes:

  1. Nearest neighbor
  2. Bilinear
  3. Bicubic
  4. hq2x

These methods have different qualities. Some lead to jaggedness (nearest neighbor), others lead to a softening of the image (bilinear) and others lead to ringing artifacts (bicubic).

Jason
+1 for WAY more detail :)
Dave Swersky
+1  A: 

It's not impossible! Check out the Genuine Fractals plug-in. It uses "fractal based interpolation algorithms" to enlarge an image without losing quality.

It's a plugin for Photoshop, but illustrates that high-quality enlargement is indeed possible. (I wonder whether it's possible to invoke it via a .Net application? Hmmm...)

Mark Maslar
That is still interpolation. That is, it's still just an intelligent guess.
Jason
True, it's still interpolation. However I've seen it used to produce large-scale graphics for trade shows, and the results are fantastic. Also consider the viewing distance. A billboard graphic might not look great from 10" away... but looks fine when viewed from a more appropriate distance.
Mark Maslar