Gaussian Curve has Changed in resize.c
Posted: 2010-09-09T22:44:58-07:00
The Gaussian curve and its weighting has changed
Old....
From the function...
now it is...
generated by the function
It has changed. and quite dramatically.
As the curve is now higher, the normalization of weightings will cause the spread to be
lower, which makes the curve much closer to both the Quadratic and Cubic filter curves
This may mean that the new form is the 'correct' one. But I will not know unless I can
review my Gaussian research notes (at home).
Nicholas, can you shed some light on this?
graphs were generated from the filter can be extracted using
Old....
From the function...
Code: Select all
static MagickRealType Gaussian(const MagickRealType x,
const ResizeFilter *magick_unused(resize_filter))
{
return(exp((double) (-2.0*x*x))*sqrt(2.0/MagickPI));
}
generated by the function
Code: Select all
static MagickRealType Gaussian(const MagickRealType x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
Unnormalized Gaussian with variance sqrt(pi)/(4*sqrt(2)):
exp(-2 x^2/sqrt(pi/2))
*/
const MagickRealType alpha = -sqrt((double) (8.0/MagickPIL));
return(exp((double) (alpha*x*x)));
}
As the curve is now higher, the normalization of weightings will cause the spread to be
lower, which makes the curve much closer to both the Quadratic and Cubic filter curves
This may mean that the new form is the 'correct' one. But I will not know unless I can
review my Gaussian research notes (at home).
Nicholas, can you shed some light on this?
graphs were generated from the filter can be extracted using
Code: Select all
convert xc: -filter Gaussian -set option:filter:verbose 1 -resize 2x2 null: