User "Tim Starling" posted a comment on MediaWiki.r85207.
Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85207#c15902
Comment:
We use sigma (i.e. radius) 0.8 on Wikimedia now. We used sigma=0.4 with older
versions of ImageMagick, because the matrix had some truncation applied to its
elements which made it look like sigma=0.8. See bug 24857.
Running "convert -sharpen 0x0.8" with "-debug Transform" reveals that it uses a
7x7 matrix, not a 3x3 matrix. So there are two reasons why it wouldn't look as
nice (as you complained on bug 25990 comment 14).
Also, I think you should make the radius more easily configurable. You could
generate the matrix from the radius and the width in MediaWiki. The formulas
are easy enough, you can port them over from ImageMagick:
<pre>
normalize=0.0;
j=(ssize_t) width/2;
i=0;
for (v=(-j); v <= j; v++)
{
for (u=(-j); u <= j; u++)
{
kernel[i]=(double) (-exp(-((double) u*u+v*v)/(2.0*MagickSigma*
MagickSigma))/(2.0*MagickPI*MagickSigma*MagickSigma));
normalize+=kernel[i];
i++;
}
}
kernel[i/2]=(double) ((-2.0)*normalize);
</pre>
http://trac.imagemagick.org/browser/ImageMagick/trunk/magick/effect.c?rev=4188#L4351
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview