News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Generating a color palette from a image in php
June 21, 2011 @ 13:09:38

Sameer Borate has posted a simple method for creating a color palette from a given image using just PHP and GD.

In the previous post we saw how we can generate a screenshot from a url. In this post we will see how we can create a color palette of the screenshot (or any other image for that matter) using PHP and GD. This can be useful if you need to quickly get the color scheme of a website or a image. Below are a few example images and their palettes generated using the program.

With the help of his code it's as easy as a call on a GetMostCommonColors object (get_color) to return the hex codes for the values found most. Also included in the post is a sample snippet showing how to pull the details from the file and output it in a grid similar to this.

0 comments voice your opinion now!
gd image process color palette popular tutorial


blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: Methods to Reduce the Load of Your Webserver by Caching Content

Mfana Ronald Conco's Blog: RabbitMQ and PHP Part 2 - Durable Queues and Persistent Messages

Brian Swan's Blog: How to Page Data with the SQL Server Drivers for PHP

SitePoint PHP Blog: HHVM and Hack - Can We Expect Them to Replace PHP?

php|architect: Using the PEAR Installer (Parts 1 & 2)


Community Events





Don't see your event here?
Let us know!


series opinion library framework voicesoftheelephpant language security podcast package introduction interview laravel application release community symfony composer tool install version

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework