Home > PHP > Function > GD > imagecolorstotal()

imagecolorstotal()

imagecolorstotal - Find out the number of colors in an image's palette

Syntax

int imagecolorstotal (resource $image)

Arguments

  • image - An image resource, returned by one of the image creation functions, such as imagecreatefromgif().

Description

Returns the number of colors in an image palette.

Version

PHP 4, 5

Return value

Returns the number of colors in the specified image's palette or 0 for truecolor images.