bicubic interpolating zoom

Adrian Page adrian at pagenet.plus.com
Mon Aug 16 18:26:32 CEST 2004


On Monday 16 August 2004 8:20 am, Michael Thaler wrote:
> * the code is much slower then Boudewijn's old algorithm

That's probably because you're calling readPixelData() four times instead of 
once. That's a slow function because of the underlying tile system. It should 
be faster using iterators, although they're not finalised yet.

> * if you scale an image that is bigger then the visible part of the screen,
> there will be some artefacts: rectangular black regions that are sometimes
> filled with garbage. If you scale an image down so that it is smaller then
> the visible part of the screen, you cannot make them go away. If you scale
> it up you can make these artefacts go away by moving the visible part of
> the image.
>
> Can someone check if this also happens with the old algorithm?

There is something wrong with the old method. If you scale a 512x512 to 
400x400, painting on the scaled image acts strangely. There seems to be some 
sort of problem with the tiles.

> I will try to find out how scaling is done in the GIMP. However, I
> downloaded the source code of the GIMP yesterday and glanced over it and I
> wasn't able to find the relevant code. I think I will need some time to
> find the relevant parts.

The image scaling code is in app/paint-funcs/paint-funcs.c, in scale_region(). 
I'm not sure how useful this is as a means to understanding the algorithm. It 
would be nice to find a good reference and implement from that.

Adrian



More information about the kimageshop mailing list