]> granicus.if.org Git - imagemagick/commitdiff
removed Gaussian filter changes for cylindrical use
authoranthony <anthony@git.imagemagick.org>
Sun, 6 Feb 2011 12:35:36 +0000 (12:35 +0000)
committeranthony <anthony@git.imagemagick.org>
Sun, 6 Feb 2011 12:35:36 +0000 (12:35 +0000)
ChangeLog
magick/composite.c
magick/resize.c

index b9afab019807dfdd293cf87cbd0229afd921597d..8997b53fbf14eb78d8b84c77bed52f8a2b28ea64 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-06  6.6.6-7 Anthony Thyssen <A.Thyssen@griffith...>
+  * Default sigma for Gauusian resize filter is now 1/2 for both
+    orthogonal resize and cylindrical EWA distortions.
+
 2011-02-02  6.6.7-5 Cristy  <quetzlzacatenango@image...>
   * Check if the font is null in RenderFreetype() to prevent fault (reference
     http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=17890).
index 86578c3a89e7852158b0090f9d678390c39c79b4..4708a7a3a4a1d13d33d832ac23c7d8064d33bab8 100644 (file)
@@ -1762,7 +1762,7 @@ MagickExport MagickBooleanType CompositeImageChannel(Image *image,
       pixel=zero;
       exception=(&image->exception);
       resample_filter=AcquireResampleFilter(image,&image->exception);
-      SetResampleFilter(resample_filter,GaussianFilter,sqrt(2.0));
+      SetResampleFilter(resample_filter,GaussianFilter,2.0);
       destination_view=AcquireCacheView(destination_image);
       composite_view=AcquireCacheView(composite_image);
       for (y=0; y < (ssize_t) composite_image->rows; y++)
index 326bababe5a8d2f01ad19951ad3e99bc20c4fcf5..2a441de8dc12830e21098bc2676c531d68ed8610 100644 (file)
@@ -239,15 +239,21 @@ static MagickRealType Gaussian(const MagickRealType x,
   /*
     Gaussian with a fixed sigma = 1/2
 
-    Gaussian Formula...
-        exp( -(x^2)/((2.0*sigma^2) ) / sqrt(2*PI*sigma^2)))
+    Gaussian Formula (1D) ...
+        exp( -(x^2)/((2.0*sigma^2) ) / sqrt(2*PI)sigma^2))
     The constants are pre-calculated...
         exp( -coeff[0]*(x^2)) ) * coeff[1]
     However the multiplier coefficent (1) is not needed and not used.
 
-    This separates the gaussian 'sigma' value from the 'blur/support' settings
-    allowing for its use in special 'small sigma' gaussians, without the filter
-    'missing' pixels when blurring because the support is too small.
+    Gaussian Formula (2D) ...
+        exp( -(x^2)/((2.0*sigma^2) ) / (PI*sigma^2) )
+    Note that it is only a change in the normalization multiplier
+    which is not needed or used when gausian is used as a filter.
+
+    This separates the gaussian 'sigma' value from the 'blur/support'
+    settings allowing for its use in special 'small sigma' gaussians,
+    without the filter 'missing' pixels because the support becomes too
+    small.
   */
   return(exp((double)(-resize_filter->coefficient[0]*x*x)));
 }
@@ -622,10 +628,9 @@ static MagickRealType Welsh(const MagickRealType x,
 %        resulting image with more aliasing effects.
 %
 %    "filter:sigma" The sigma value to use for the Gaussian filter
-%        only.  Defaults to '1/2' for orthogonal and 'sqrt(2)/2' for
-%        cylindrical usage. It effectially provides a alturnative to
-%        'blur' for Gaussians without it also effecting the final
-%        'practical support' size.
+%        only.  Defaults to '1/2'. Using a different sigme effectially
+%        provides a method of using the filter as a 'blur' convolution.
+%        Particularly when using it for Distort.
 %
 %    "filter:b"
 %    "filter:c" Override the preset B,C values for a Cubic type of
@@ -839,8 +844,8 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image,
   */
   filter_type=mapping[filter].filter;
   window_type=mapping[filter].window;
-  resize_filter->blur = blur;
-  sigma = 0.5;
+  resize_filter->blur = blur;   /* function argument blur factor */
+  sigma = 0.5;    /* guassian sigma of half a pixel by default */
   /* Promote 1D Windowed Sinc Filters to a 2D Windowed Jinc filters */
   if (cylindrical != MagickFalse && filter_type == SincFastFilter
        && filter != SincFastFilter )
@@ -910,10 +915,6 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image,
         resize_filter->scale=filters[JincFilter].scale;
         /* number of lobes (support window size) remain unchanged */
         break;
-      case GaussianFilter:
-        /* Cylindrical Gaussian sigma is sqrt(2)/2. */
-        sigma = (MagickRealType) (MagickSQ2/2.0);
-        break;
       default:
         break;
     }
@@ -938,11 +939,11 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image,
   artifact=GetImageArtifact(image,"filter:sigma");
   if (artifact != (const char *) NULL)
     sigma=StringToDouble(artifact);
-  /* Define coefficents for Gaussian (assumes no cubic window) */
+  /* Define coefficents for Gaussian */
   if ( GaussianFilter ) {
     resize_filter->coefficient[0]=1.0/(2.0*sigma*sigma);
     resize_filter->coefficient[1]=(MagickRealType) (1.0/(Magick2PI*sigma*
-      sigma)); /* unused */
+      sigma)); /* Normalization Multiplier - unneeded for filters */
   }
 
   /* Blur Override */