imagecolorclosest

PHP 4, PHP 5, PHP 7, PHP 8
imagecolorclosest - Get the index of the closest color to the specified color
Manual
Code Examples

Example #1 Search for a set of colors in an image

Result: #0: Search (254, 145, 154); Closest match: (252, 150, 148). #1: Search (153, 145, 188); Closest match: (148, 150, 196). #2: Search (153, 90, 145); Closest match: (148, 90, 156). #3: Search (255, 137, 92); Closest match: (252, 150, 92).
PHP Version:


Function imagecolorclosest:

Image Processing and GD Functions

Most used PHP functions