Re: proper scaling of the Jinc filter for EWA use
Posted: 2011-11-15T13:36:42-07:00
perhaps it should be called "gensinc" or was that your "play on words"
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=19636
My kingdom for a pun with legs!
No I meant with that when I was looking at windowed Sinc (for orthogonal 2-pass resize) I found little evidence that one was greatly better than others. It just seemed to me that windowing functions did their job of limiting the Sinc function, but everything else to be rather opinionated. But then again image resizing for generate is not something that is very qualitative.NicolasRobidoux wrote:Anthony: Did I read right that you find results quite good with Bartlett-windowed Sinc?
Code: Select all
convert rose: -distort Resize 400% show:
Code: Select all
convert rose: -filter Lanczos -distort Resize 400% show:
Code: Select all
convert rose: -filter Point -distort Resize 400% show:
This may be the most sensible decision once the dust settles. I am not 100% sure yet that (unsharpened) Sinc-windowed Jinc is better than Jinc-windowed Jinc, but if so, it would be a natural thing to do to call it EWA Lanczos.anthony wrote:Do you think it would be better to make EWA Lanczos, a Sinc Windowed Jinc rather than Jinc windowed Jinc?...
Code: Select all
convert sl.png -filter Lanczos -distort Resize 3000% sl_JincJinc3.png
convert sl.png -define filter:filter=Jinc -define filter:window=Sinc -define filter:lobes=3 -distort Resize 3000% sl_SincJinc3.png
convert sl.png -filter Lanczos -resize 3000% sl_orthoLanczos3.png
As it turns out, the proof, due to yours truly, involves pointing out that a hash pattern is an image constant on both rising and descending diagonals, and at the intersection of such diagonals something must break.No resampling method (linear or nonlinear) can be simultaneously interpolatory (meaning that if you sample at an original pixel location you get back the original value) and preserve (the main) diagonals when additional pixels are added so as to double the sampling rate in both directions (preserving diagonals means that if your original image is constant on, say, rising diagonals, then the resampled image has the same property; the bit about doubling the sampling rate corresponds to half the people understand when enlarging an image by a factor of two).
Code: Select all
convert sl.png -define filter:filter=Jinc -define filter:window=Sinc -define filter:lobes=3 -define filter:blur=.9264075766146 -distort Resize 3000% sl_SincJinc3Support3.png
convert sl.png -define filter:filter=Jinc -define filter:window=Sinc -define filter:lobes=3 -define filter:blur=.883751202473632831 -distort Resize 3000% sl_SincJincASharp.png
Code: Select all
convert sl.png -define filter:filter=Jinc -define filter:window=Kaiser -define filter:lobes=3 -distort Resize 3000% sl_JincKaiser3.png
convert rose: -define filter:filter=Jinc -define filter:window=Kaiser -define filter:lobes=3 -distort Resize 3000% rose_JincKaiser3.png
So, there you have it: Orthogonal Lanczos 3 is interpolatory and does not blur hash patterns but has jaggies galore when upsampling diagonal lines, and Jinc-Jinc and Sinc-Jinc EWA are not interpolatory, they blur hash patterns, and they do quite well with 45 degree lines.
Yes, I have.fmw42 wrote: Have you considered a shape that is some kind of blend between orthogonal (square) and circular, such as a rounded square for the resampling area? Is that even feasible? Or a weighted average of the two (orthogonal and circular)...
Code: Select all
#define Alpha
(7.0155866698156187535)
Code: Select all
convert null: -define filter:filter=Box \
-define filter:window=Kaiser \
-define filter:alpha=8.0 \
-define filter:support=1.0 \
-define filter:verbose=1 \
-resize 2 null: >t.dat
echo -e 'set grid; plot "t.dat" with lines; pause 100000;' | gnuplot &