Code: Select all
convert -filter Lanczos2 -distort Resize
Code: Select all
convert logo: -gravity center -crop 80x80+0+0 -filter Gaussian -resize 800% show:
convert logo: -gravity center -crop 80x80+0+0 -filter Gaussian \
-define filter:sigma=.70710678 -resize 800% show:
NicolasRobidoux wrote:@Anthony: Thank you much for fixing this bug.
P.S. Aren't I the one who started messing with Kaiser alpha values?
NicolasRobidoux wrote:I'm not saying that the other filters are not good, but a quick look suggests that unsharpened Jinc-windowed Jinc 2 a.k.a.may be quite a good "light touch with just a bit of denoising/antialiasing/sharpening" downsampler for DSLR photographs. Definitely not "punch me in the face" sharp; more like a civilized gentleman.Code: Select all
convert -filter Lanczos2 -distort Resize
(Yes, I know it's a bit on the blurry side for no-op. I'm talking about linear light downsampling, here.)
Code: Select all
)cl a
digits 100
R1 := 3.831705970207512315614435886308160766564545274287801928762298989918839309519011470214112874757423127
r1 := R1 / %pi
R2 := 7.0155866698156187535370499814765247432763115029113138960553778269854960155020186630727149301794664578066071840984767118820251703769720326548673375642560309232023970190386543841800591275430452193373925
r2 := R2 / %pi
jinc x == besselJ(1,%pi*x)/x
sinc x == besselJ(1,x*(R1/r2))/x
l x == if (x<r2) then ( sinc(x) * jinc(x) ) else 0.
plus x == max(l x,0)
minus x == -min(l x, 0)
f r == [ r, sqrt(1.+1)*r, 2*r, sqrt(1.+4)*r, sqrt(4.+4)*r, 3*r, sqrt(9.+1.)*r, sqrt(9.+4)*r, 4*r, sqrt(16.+1)*r, sqrt(9.+9)*r, sqrt(16.+4)*r, 5*r ]
z := l 1.e-128
gplus(r) == _
( _
4 * _
( plus((f(r)).1) _
+ plus((f(r)).2) _
+ plus((f(r)).3) _
+ plus((f(r)).5) _
+ plus((f(r)).6) _
+ plus((f(r)).9) _
+ plus((f(r)).11) _
+ plus((f(r)).13) _
+ 2 * _
( plus((f(r)).4) _
+ plus((f(r)).7) _
+ plus((f(r)).8) _
+ plus((f(r)).10) _
+ plus((f(r)).12) ) ) _
) / _
( _
z + _
4 * _
( l((f(r)).1) _
+ l((f(r)).2) _
+ l((f(r)).3) _
+ l((f(r)).5) _
+ l((f(r)).6) _
+ l((f(r)).9) _
+ l((f(r)).11) _
+ l((f(r)).13) _
+ 2 * _
( l((f(r)).4) _
+ l((f(r)).7) _
+ l((f(r)).8) _
+ l((f(r)).10) _
+ l((f(r)).12) ) ) )
gminus(r) == _
( _
4 * _
( minus((f(r)).1) _
+ minus((f(r)).2) _
+ minus((f(r)).3) _
+ minus((f(r)).5) _
+ minus((f(r)).6) _
+ minus((f(r)).9) _
+ minus((f(r)).11) _
+ minus((f(r)).13) _
+ 2 * _
( minus((f(r)).4) _
+ minus((f(r)).7) _
+ minus((f(r)).8) _
+ minus((f(r)).10) _
+ minus((f(r)).12) ) ) _
) / _
( _
z + _
4 * _
( l((f(r)).1) _
+ l((f(r)).2) _
+ l((f(r)).3) _
+ l((f(r)).5) _
+ l((f(r)).6) _
+ l((f(r)).9) _
+ l((f(r)).11) _
+ l((f(r)).13) _
+ 2 * _
( l((f(r)).4) _
+ l((f(r)).7) _
+ l((f(r)).8) _
+ l((f(r)).10) _
+ l((f(r)).12) ) ) )
g x == gplus x - gminus x
[ g(1.12579115877571800+i*.000000000000000001) for i in 3..31 ]
-- Residual for the one with least possible deviation:
g(1.125791158775718017)
-- Actual blur value:
1/1.125791158775718017
Code: Select all
convert INPUT.IMG -filter Lanczos2 \
-define filter:blur=0.88826421508540347 \
-distort Resize PERCENT% OUTPUT.IMG
convert INPUT.IMG -filter Lanczos \
-define filter:blur=0.88549061701764 \
-distort Resize PERCENT% OUTPUT.IMG
convert INPUT.IMG -filter Lanczos \
-define filter:blur=0.88451002338585141 \
-define filter:lobes=4 -distort Resize PERCENT% OUTPUT.IMG
NicolasRobidoux wrote:P.S.3 I used to think that Anthony was out of his mind to use Lagrange with a million lobes. Now, I'm starting to see that sometimes lots of lobes pay off?
P.S.6 Too many filters, too little time.
P.S.10 Now it's going to be really interesting to see how the quantitative errors that my student Adam Turcotte is computing line up
False accusations. (Apologies.)anthony wrote:...
When have I ever used Lagrange with a million lobes?
...
Return to “Digital Image Processing”
Users browsing this forum: No registered users and 1 guest