Home > PHP > Function > > ImagickPixel::isSimilar()

ImagickPixel::isSimilar()

ImagickPixel::isSimilar - Check the distance between this color and another

Syntax

bool ImagickPixel::isSimilar (ImagickPixel $color, float $fuzz)

Arguments

  • color - The ImagickPixel object to compare this object against.
  • fuzz - The maximum distance within which to consider these colors as similar. The theoretical maximum for this value is the square root of three (1.732).

Description

Checks the distance between the color described by this ImagickPixel object and that of the provided object, by plotting their RGB values on the color cube. If the distance between the two points is less than the fuzz value given, the colors are similar.

Version

PHP PECL imagick 2.0.0

Return value

Returns TRUE on success.