On 8/8/07, Sven Neumann <[EMAIL PROTECTED]> wrote:
> On Wed, 2007-08-08 at 13:58 +0200, Geert Jordaens wrote:
> > What would be a correctly designed filter for scaling down by factor 2?
> I'd say the code in app/base/tile-pyramid.c, in particular
> tile_pyramid_write_quarter() counts as a well-done and efficient filter
> for this purpose.

This code implements a perfect box filter for this case, what needs to
be added on top
of this to be able to do good estimate (maybe even exact) box filter
resamplings is trilinear interpolation by doing bilinear interpolation
on the two closest 50% 25% 12.5% .. levels of
the scaled pyramid. The current GIMP view implements nearest neighbour
interpolation on the nearest larger level, and the GEGL code (which
the GIMP code is based on) uses bilinear interpolation on the closest
larger level. If someone wants to work on creating the coded needed to
implement trilinear (linear interpolation between bilinear on the
larger and smaller versions than the exact scale, it is work that is
needed for both GIMP itself internally on the short term and
externally when all this code becomes deprecated by the migration to

If adding such functionality to the GIMP itself it would perhaps be
best to do it by directly reusing the code paths used by the display

/Øyvind K.
«The future is already here. It's just not very evenly distributed»
                                                 -- William Gibson
http://pippin.gimp.org/                            http://ffii.org/
Gimp-developer mailing list

Reply via email to