]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 26 Mar 2010 01:27:47 +0000 (01:27 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 26 Mar 2010 01:27:47 +0000 (01:27 +0000)
magick/enhance.c

index f28a3688a7753067f17e14b4bc5b971918a3dfc0..629286a49e7a9dc32bad02a6d250272c50d3b318 100644 (file)
@@ -290,10 +290,7 @@ MagickExport MagickBooleanType BrightnessContrastImageChannel(Image *image,
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   alpha=contrast;
-  if ((100-contrast) <= 0.1)
-    alpha=99.999999;
-  slope=MagickPI*(((alpha*alpha)/20000.0)+(3.0*alpha/200.0))/4.0;
-  slope=sin(slope)/cos(slope)+1.0;
+  slope=tan(MagickPI*(alpha/100.0+1.0)/4.0);
   if (slope < 0.0)
     slope=0.0;
   intercept=brightness/100.0+((100-brightness)/200.0)*(1.0-slope);