@@ -1693,7 +1693,7 @@ MagickExport MagickBooleanType IsColorSimilar(const Image *image,
1693
1693
GetPixelOpacity (p ) : OpaqueOpacity )- (image -> matte != MagickFalse ?
1694
1694
q -> opacity : OpaqueOpacity ));
1695
1695
distance = pixel * pixel ;
1696
- if (distance > fuzz )
1696
+ if (distance >= fuzz )
1697
1697
return (MagickFalse );
1698
1698
/*
1699
1699
Generate a alpha scaling factor to generate a 4D cone on colorspace
@@ -1722,15 +1722,15 @@ MagickExport MagickBooleanType IsColorSimilar(const Image *image,
1722
1722
pixel *=2.0 ;
1723
1723
}
1724
1724
distance += scale * pixel * pixel ;
1725
- if (distance > fuzz )
1725
+ if (distance >= fuzz )
1726
1726
return (MagickFalse );
1727
1727
pixel = (double ) GetPixelGreen (p )- (double ) q -> green ;
1728
1728
distance += scale * pixel * pixel ;
1729
- if (distance > fuzz )
1729
+ if (distance >= fuzz )
1730
1730
return (MagickFalse );
1731
1731
pixel = (double ) GetPixelBlue (p )- (double ) q -> blue ;
1732
1732
distance += scale * pixel * pixel ;
1733
- if (distance > fuzz )
1733
+ if (distance >= fuzz )
1734
1734
return (MagickFalse );
1735
1735
return (MagickTrue );
1736
1736
}
@@ -1906,7 +1906,7 @@ MagickPrivate MagickBooleanType IsIntensitySimilar(const Image *image,
1906
1906
return (MagickTrue );
1907
1907
fuzz = GetFuzzyColorDistance (image ,(const Image * ) NULL );
1908
1908
pixel = GetPixelIntensity (image ,p )- GetPixelIntensity (image ,q );
1909
- if ((pixel * pixel ) > fuzz )
1909
+ if ((pixel * pixel ) >= fuzz )
1910
1910
return (MagickFalse );
1911
1911
return (MagickTrue );
1912
1912
}
@@ -1979,7 +1979,7 @@ MagickExport MagickBooleanType IsMagickColorSimilar(const MagickPixelPacket *p,
1979
1979
OpaqueOpacity )- (q -> matte != MagickFalse ? (double ) q -> opacity :
1980
1980
(double ) OpaqueOpacity );
1981
1981
distance = pixel * pixel ;
1982
- if (distance > fuzz )
1982
+ if (distance >= fuzz )
1983
1983
return (MagickFalse );
1984
1984
/*
1985
1985
Generate a alpha scaling factor to generate a 4D cone on colorspace.
@@ -1999,7 +1999,7 @@ MagickExport MagickBooleanType IsMagickColorSimilar(const MagickPixelPacket *p,
1999
1999
{
2000
2000
pixel = p -> index - q -> index ;
2001
2001
distance += pixel * pixel * scale ;
2002
- if (distance > fuzz )
2002
+ if (distance >= fuzz )
2003
2003
return (MagickFalse );
2004
2004
scale *=(MagickRealType ) (QuantumScale * ((double ) QuantumRange - p -> index ));
2005
2005
scale *=(MagickRealType ) (QuantumScale * ((double ) QuantumRange - q -> index ));
@@ -2022,15 +2022,15 @@ MagickExport MagickBooleanType IsMagickColorSimilar(const MagickPixelPacket *p,
2022
2022
pixel *=2.0 ;
2023
2023
}
2024
2024
distance += pixel * pixel * scale ;
2025
- if (distance > fuzz )
2025
+ if (distance >= fuzz )
2026
2026
return (MagickFalse );
2027
2027
pixel = GetPixelGreen (p )- q -> green ;
2028
2028
distance += pixel * pixel * scale ;
2029
- if (distance > fuzz )
2029
+ if (distance >= fuzz )
2030
2030
return (MagickFalse );
2031
2031
pixel = GetPixelBlue (p )- q -> blue ;
2032
2032
distance += pixel * pixel * scale ;
2033
- if (distance > fuzz )
2033
+ if (distance >= fuzz )
2034
2034
return (MagickFalse );
2035
2035
return (MagickTrue );
2036
2036
}
@@ -2078,7 +2078,7 @@ MagickExport MagickBooleanType IsOpacitySimilar(const Image *image,
2078
2078
return (MagickTrue );
2079
2079
fuzz = GetFuzzyColorDistance (image ,(const Image * ) NULL );
2080
2080
pixel = (MagickRealType ) GetPixelOpacity (p )- (MagickRealType ) GetPixelOpacity (q );
2081
- if ((pixel * pixel ) > fuzz )
2081
+ if ((pixel * pixel ) >= fuzz )
2082
2082
return (MagickFalse );
2083
2083
return (MagickTrue );
2084
2084
}
0 commit comments