YouTip LogoYouTip

Php Imagecolorclosest

PHP imagecolorclosest – Get the index of the color closest to the specified color |

-- Learning not just skills, but dreams!

PHP Tutorial

PHP Tutorial PHP Introduction PHP Installation PHP Syntax PHP Variables PHP echo/print PHP EOF(heredoc) PHP Data Types PHP Type Comparison PHP Constants PHP String PHP Operators PHP If...Else PHP Switch PHP Arrays PHP Array Sort PHP Superglobals PHP While Loop PHP For Loop PHP Functions PHP Magic Constants PHP Namespaces PHP OOP PHP Quiz

PHP Forms

PHP Forms PHP Form Validation PHP Form - Required Fields PHP Form - Validate Email and URL PHP Complete Form Example PHP $_GET Variable PHP $_POST Variable

PHP Advanced

PHP Multidimensional Arrays PHP Date PHP Include PHP File PHP File Upload PHP Cookie PHP Session PHP E-mail PHP Secure E-mail PHP Error PHP Exception PHP Filters PHP Advanced Filters PHP JSON

PHP 7 New Features

PHP 7 New Features

PHP Database

PHP MySQL Introduction PHP MySQL Connect PHP MySQL Create Database PHP MySQL Create Table PHP MySQL Insert Data PHP MySQL Insert Multiple Data PHP MySQL Prepared Statements PHP MySQL Read Data PHP MySQL Where PHP MySQL Order By PHP MySQL Update PHP MySQL Delete PHP ODBC

PHP XML

XML Expat Parser XML DOM XML SimpleXML

PHP and AJAX

AJAX Introduction AJAX PHP AJAX Database AJAX XML AJAX Live Search AJAX RSS Reader AJAX Poll

PHP Reference

PHP Array PHP Calendar PHP cURL PHP Date PHP Directory PHP Error PHP Filesystem PHP Filter PHP FTP PHP HTTP PHP Libxml PHP Mail PHP Math PHP Misc PHP MySQLi PHP PDO PHP SimpleXML PHP String PHP XML PHP Zip PHP Timezones PHP Image Processing PHP RESTful PHP PCRE PHP Available Functions PHP Composer

PHP 5 Timezones PHP RESTful

Explore Further

  • Web Services
  • Scripting Languages
  • Development Tools
  • Software
  • Web Service
  • Computer Science
  • Programming
  • Web Design & Development
  • Programming Languages
  • Scripting

PHP imagecolorclosest - Get the index of the color closest to the specified color

PHP Image Processing PHP Image Processing

imagecolorclosest β€” Get the index of the color closest to the specified color.

Syntax

int imagecolorclosest ( resource $image , int $red , int $green , int $blue )

Returns the index of the color in the image palette that is "closest" to the specified RGB value.

The "distance" between the specified color and each color in the palette is calculated by treating the RGB values as coordinates of a point in a 3D space.

If the image was created from a file, only the colors used in the image are analyzed. Colors that appear only in the palette are not analyzed.

Related Articles

PHP Image Processing PHP Image Processing

← Php ImagecolorsetPhp Imagecolorresolve β†’