After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 158127 - improve scale, rotate, etc. using a sinc-based interpolation algorithm
improve scale, rotate, etc. using a sinc-based interpolation algorithm
Status: RESOLVED DUPLICATE of bug 162250
Product: GIMP
Classification: Other
Component: General
unspecified
Other All
: Normal enhancement
: Future
Assigned To: GIMP Bugs
GIMP Bugs
: 163674 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-11-13 00:08 UTC by Albert Cahalan
Modified: 2005-01-11 18:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Albert Cahalan 2004-11-13 00:08:39 UTC
Currently, image scaling (and rotation AFAIK, etc.) offers
three interpolation options: nearest, linear, cubic

The most correct option, sinc, is missing. (this is a 1/sin(x) function)

Note also that _all_ of these should be done in a linear-light (gamma==1.0)
color space for correct output. The sRGB gamma curve, including the linear
portion near black, should be used when conversion is needed.
Comment 1 Sven Neumann 2004-11-13 02:37:06 UTC
Could you perhaps try to rephrase this as an enhancement request? It would sound
less harsh and might increase the likelihood that it would be implemented one day.
Comment 2 Albert Cahalan 2004-11-13 04:01:04 UTC
I don't mean to sound harsh.

By "most correct", I really mean it, in a math sense.
Think FFT, waves, bandwidth, signals, Nyquist limit, etc.
The differance will be clearly visible if you rotate
a zone plate image (a type of test image) in 5-degree
increments until you go around all 360 degrees.

The comment about gamma is because it is a very common
and serious error to ignore gamma.

BTW, for some of these operations, I suspect that the most
efficient implementation would involve operations done in
frequency space. Take an FFT on each gamma==1.0 channel, do
some stuff, and then use an inverse FFT to get back. This
would be exactly equivalent to using the sinc() function.
(sorry I can't better define "some stuff" for you)
Comment 3 Sven Neumann 2004-11-13 12:54:42 UTC
Sorry, but I don't think such a bug report makes much sense. If you want to add
a better interpolation function, please come up with a patch or at least an
algorithm that can be integrated. I could point out several dozens of algorithms
that are better than the one that GIMP offers at the moment. It would however
not improve the situation at all if we had a bug report for each of these.

As it stands this report is way too vague to be useful. The summary is
misleading and lacks the term "interpolation" that would allow to find it when
searching Bugzilla. The report itself doesn't include any useful information,
not even a pointer to external resources. Unless you change that, I will have to
close it as INCOMPLETE.
Comment 4 Sven Neumann 2004-11-13 13:24:26 UTC
Oops, didn't meant to change the summary to become even less useful. That was an
accident, changing it back and setting to NEEDINFO.
Comment 5 Albert Cahalan 2004-11-13 14:22:34 UTC
Heh, I just got told last night that I should report lots of
separate bugs, and now you say that would be bad. Anyway, the
third hit on Google for "sinc degree rotate" (no quotes) is:

http://home.no.net/dmaurer/~dersch/interpolator/interpolator.html

I note that the author of that page is already using sinc() for a
GIMP plug-in. So, I expect that GIMP-friendly GPL code is available
and would merely need to be integrated into the core app.
Comment 6 Sven Neumann 2004-11-13 15:27:37 UTC
See, now this report starts to make sense. And of course you should file
separate bug reports for separate issues. I certainly didn't say that would be bad.
Comment 7 weskaggs 2004-12-13 21:36:28 UTC
Using sinc would probably give nice results, but it means convolving with a
rather large matrix, which would be slow:  the sinc-based interpolation
described on Dersch's page uses a 16x16 convolution matrix.  It would be
interesting to investigate using an FFT for this -- but I don't know whether
even a fast FFT implementation such as FFTW would be fast enough to be usable in
GIMP.  And it would require a lot of memory, too.
Comment 8 Joao S. O. Bueno 2005-01-11 16:08:38 UTC
*** Bug 163674 has been marked as a duplicate of this bug. ***
Comment 9 Joao S. O. Bueno 2005-01-11 16:11:32 UTC
Bug 163174 also has more links to imporved algorithms and discussions. 
Comment 10 Sven Neumann 2005-01-11 17:27:23 UTC
See also bug #162250 which has a patch that is almost ready for inclusion (and
should end up being applied to CVS pretty soon).
Comment 11 Sven Neumann 2005-01-11 18:33:20 UTC
Now that the patch from bug #162250 is in CVS, it's probably best to close this
report as duplicate of the newer one.

*** This bug has been marked as a duplicate of 162250 ***