views:

445

answers:

2

I am in a position where relatively low resolution images are provided (via an API, higher resolution images are not available) and high resolution images need to be generated.

I've taken a look at PIL and it's just great for about everything... Except scaling up images.

It has the common resizing algorithms:

  • Nearest Neighbor
  • Bilinear
  • Bicubic
  • Anti-aliased

I would like to use Fractal Resizing (as per jeff's post on coding horror), but alas, PIL has no support for this kind of resizing.

Further Google searches yield no alternative libraries to provide fractal image resizing either.

Does such a thing exist or do I really have to buckle down and write my own fractal resizing algorithm?

I'm no expert but from my current vantage point, that looks like a pretty steep learning curve :(

If no such library exists, maybe you have some advice where to learn about fractal compression algorithms?

+6  A: 

There are algorithms, and you're definitely not going to find them in Python. To start with, you can take this paper:

Daniel Glasner, Shai Bagon, and Michal Irani, "Super-Resolution from a Single Image," in Proceedings of the IEEE International Conference on Computer Vision, Kyoto, Japan, 2009.

It is very much state of the art, highly sophisticated, and producing promising results. If you ever make it into a python implementation please release it to the public :)

Paul
I absolutely will... if I can convince my boss haha (I have a feeling if it looks like it'll take more than a few days to write, we'll just use a cgi or something. this isn't our core business)
Jiaaro
+1  A: 

Fractal-based image scaling is still quite unusual and hasn't settled down onto one accepted-best algorithm yet. I'm afraid you aren't going to find it in standard image processing libraries yet.

It's also not invariably preferable to bicubic. It can have artefacts which will be undesirable for some kinds of images. For me, Jeff's example image looks a bit weird and unnatural around the sharp edges like the right-hand-side of the nose. Better for some values of ‘better’, sure, but I wouldn't blanket-apply it to all my images.

(This is the case with other ‘advanced’ upscaling techniques, too, including the better-known and more widely-implemented Lanczos/Sinc method.)

bobince