{"repo":"ksubileau/color-thief-php","free":true,"listed":false,"github":"https://github.com/ksubileau/color-thief-php","clone":"git clone https://github.com/ksubileau/color-thief-php.git","description":"Grabs the dominant color or a representative color palette from an image. Uses PHP and GD, Imagick or Gmagick.","language":"PHP","stars":636,"topics":["php","color-palette","imagick","gd","image-processing","dominant-colors"],"license":"MIT","category":"media-processing","readme_excerpt":"Color Thief PHP ============== A PHP library for grabbing the dominant color or a representative color palette from an image. It is a PHP port of the Color Thief Javascript library, using the MMCQ (modified median cut quantization) algorithm from the Leptonica library. See examples --- Why Color Thief? Extracting meaningful colors from an image unlocks a surprising range of use cases: generating dynamic themes that match a user's uploaded avatar, building visually coherent product cards from cover art, creating adaptive UI backgrounds for music or video players, or simply analyzing the dominant hues of a dataset of images. Color Thief PHP does this for you, without any manual color-picking, and returns results in the color format that suits you: hex, CSS rgb() , HSL, OKLCH, CMYK, or a plain integer. You can ask for a single dominant color, a ranked palette of up to 20 colors, or semantic swatches (Vibrant, Muted, DarkVibrant, etc.). --- Requirements - PHP 8.2 or higher - Fileinfo extension - One or more PHP extensions for image processing: - GD = 2.0 - Imagick = 2.0 (but = 3.0 for CMYK images) - Gmagick = 1.0 - Supports JPEG, PNG, GIF and WEBP images. --- Getting started Install via Composer The recommended way to install Color Thief is through Composer: Get the dominant color All functionality is exposed through the ColorThief\\ColorThief class. Instantiate it once and reuse it across multiple images. getColor() returns a RgbColor object (or null if no color could be extracte","default_branch":null,"files":null,"tree":[],"storefront":"/r/ksubileau","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ksubileau/color-thief-php/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}