RSS/Atom feed Twitter
Site is read-only, email is disabled

Bicubic scaling routines in GIMP

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

Bicubic scaling routines in GIMP Michael Thaler 16 Aug 14:23
  Bicubic scaling routines in GIMP Simon Budig 16 Aug 15:07
Bicubic scaling routines in GIMP Pedro Gimeno Fortea 18 Aug 03:24
Michael Thaler
2004-08-16 14:23:08 UTC (over 19 years ago)

Bicubic scaling routines in GIMP

Dear GIMP developers,

I want to implement a bicubic scaling routine for Krita, a painting and image processing application for KDE. As a proof of concept I coded a bilinear scaling routine this morning which does work quite well if the scale factor is not too small or too large (e.g. in the range 0.5 - 2.0). The algorithm is from "Numerical Recipes". This book also has a chapter about bicubic interpolation and I think that it would not be too hard to improve my original very simple algorithm to use bicubic interpolation.

As a long-time GIMP user, I know that the GIMP scaling algorithms are really good and I would like to have a look on the algorithms and maybe use them for scaling in Krita. I looked at the GIMP source code but I could not find the relevant parts of the code. Could you please tell me in what files the relevant parts of the code are?

I know you would prefer people to work on GIMP and I think GIMP is really a great application and I love to use it. But there are two reasons why I prefer to work on Krita:

- first I am an absolut beginner in computer graphics and I want to learn some basic things about computer graphics. Krita is still really unfinished and a lot of very basic things are still missing. This gives me the possibility to code some basic stuff like scaling algorithms or simple filters. GIMP is already very advanced and there is nothing I could do to improve it.

- second I want to learn some C++ and Krita is written in C++.

I hope you understand this and I hope someone can give me a hand with finding the scaling algorithms in the GIMP source code,

Greetings, Michael

Simon Budig
2004-08-16 15:07:32 UTC (over 19 years ago)

Bicubic scaling routines in GIMP

Michael Thaler (michael.thaler@physik.tu-muenchen.de) wrote:

As a long-time GIMP user, I know that the GIMP scaling algorithms are really good and I would like to have a look on the algorithms and maybe use them for scaling in Krita. I looked at the GIMP source code but I could not find the relevant parts of the code. Could you please tell me in what files the relevant parts of the code are?

The scaling code is in app/paint-funcs/paint-funcs.c, see the function "scale_region" (this is - besides app/base/ - the "ancient cruft" section of the gimp sourcecode).

[...]

GIMP is already very advanced and there is nothing I could do to improve it.

Feel free to work on your own application, but the idea that there is nothing left to do to improve Gimp definitely is wrong... :-)

[...]

I hope you understand this and I hope someone can give me a hand with finding the scaling algorithms in the GIMP source code,

Hope this helps,
Simon

Pedro Gimeno Fortea
2004-08-18 03:24:26 UTC (over 19 years ago)

Bicubic scaling routines in GIMP

On 08/16/04 15:23:08, Michael Thaler wrote:

I looked at the GIMP source code but I could not find the
relevant parts of the code. Could you please tell me in what files the relevant parts of the code are?

It's possible to perform scaling by two means. If invoked from the Scale Image menu entry, the affected code is in app/paint-funcs/paint- funcs.c as Simon already pointed out. If invoked via the Scale tool, then it's the code in app/core/gimpdrawable-transform.c the one in effect.

Note, however, that the code in paint-funcs.c does not implement cubic resampling when scaling down.