Re: [Gimp-developer] Downscaling quality
Hi, just sending this link again since I dont think my last post got to the m.l. It's the article Graeme refers to which covers all this rather well. http://www.worldserver.com/turk/computergraphics/ResamplingFilters.pdf /gg ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Downscaling quality.
Hi, On Fri, 2007-08-10 at 10:54 +0200, Geert Jordaens wrote: I get the feeling that we are mixing 2 things here. 1. scaling for display purposes (uniform X and Y scaling) 2. scaling as a effective drawing transformation. (X and Y scale can be different) For the second case, it only needs a small modification to the pyramid solution. Instead of always scaling down both directions, one could optionally scale by 50% in vertical or horizontal direction only. This would allow you to reduce the image to a size that is close enough to the destination size. From there on, you can do linear interpolation. Sven ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Downscaling quality.
On Fri, 10 Aug 2007 04:34:03 +0200, Graeme Gill [EMAIL PROTECTED] wrote: Øyvind Kolås wrote: More theoretically correct resampling methods like a Sinc filter with an infinite neighbourhood definitly is not something one would want in the view code. I'm not sure what you mean by view code here. Preview? Sinc filter with infinite window is clearly a theoretical abstraction that can never be implemented. That's why Lanczos derived his finite windows function (in around 1930 IIRC!). I suggest reading the article, rather than jumping to the conclusion that a Sinc filter is a recommended option. Of course if near enough is good enough, then a box filter will work acceptably. Graeme Gill. http://www.worldserver.com/turk/computergraphics/ResamplingFilters.pdf Reading the article you refer to clearly shows the frequency response of all these options. The crudity of box and tent is an incentive to find a better option. Lanczos would seem to be one better option if it can be correctly implemented on reduction. Why do you say anyone is jumping to conclusions? Lanczos (L3 would be likely to be used) gives best suppression of side lobes and more passband than gaussian the only other option without huge side lobes that give heavy artifacts. As Øyvind Kolås pointed out this may be much more relevant for other operations such as rotation and scew. /gg ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Downscaling quality.
Øyvind Kolås wrote: On 8/9/07, Graeme Gill [EMAIL PROTECTED] wrote: Øyvind Kolås wrote: 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. I'd suggest having a read of Graphics Gems I, page 147, Filters For Common Resampling Tasks by Ken Turkowski. Box and tent filters are easy to implement, but not necessarily the best choices... For downscaling (decimating) box filtering is orders of magnitude better than the buggy erronious use of interpolation that currently is used in GIMP. More theoretically correct resampling methods like a Sinc filter with an infinite neighbourhood definitly is not something one would want in the view code. I also doubt you will see much of a difference when doing things like generating thumbnails etc. My gut feeling is that high quality resampling matters a lot more for other transformations than downscaling. /Øyvind K. I get the feeling that we are mixing 2 things here. 1. scaling for display purposes (uniform X and Y scaling) 2. scaling as a effective drawing transformation. (X and Y scale can be different) The tile-pyramid as it is now seems to me only usefull for the 1ste case. If the downscaling is rewritten (completed) then it should be for display. 1. Calculate the image pyramid. [filter] - [:2] - [filter] - [:2] - [filter] - [:2] 2. Linear interpolate between level and level-1 I leave in the middle if the [filter] is a box, gauss or sinc filter. For the downscaling as a effective drawing transformation, the pyramid can only be used for reducing to the maximum X and Y scale in 2D. What afterwarts only, in 1D for the smaler scale? scale X = 0.15 scale X = 0.30 [filter] - [:2] (2D X and Y) [filter] - [:2] (1D X) Geert ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer