News Feed
Sections




News Archive
feed this:

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


Mikko Koppanen's Blog:
Color analysis
November 05, 2007 @ 10:26:00

In the latest entry to his blog, Mikko Koppanen shows how to take the power of Imagick and harness it to check and see what sorts of colors an image contains:

The code in the example reduces the image colors to 10, then discards all but one pixel of every color and then creates the palettes out of those colors. This might not be the most accurate way to do this, but at least it's fast.

His code makes three different "palettes" from the image - average, dark and light - and outputs them as a range of colored boxes for each all of the three palettes. Examples of the output are also included in the post.

0 comments voice your opinion now!
imagick color palette average dark light tutorial imagick color palette average dark light tutorial


BarelyFitz.com:
CSS Colors - Take Control Using PHP
June 02, 2006 @ 06:16:07

On BarelyFitz Designs, there's a handy tutorial that's been posted to help developers out there combine the powers of PHP and CSS to form a sort of color management system for their site.

While many web sites use powerful programming environments to create HTML, these same tools are usually ignored when it comes to creating Cascading Style Sheets (CSS). This article describes how to take control of your colors in CSS using PHP. You will learn how to:
  • Centralize your color definitions using variables.
  • Separate presentation and content by referring to colors using abstract names such as base and highlight.
  • Automatically generate a color gradient from a single base color:
  • Automatically adjust the contrast of foreground colors so they can viewed on top of your background colors

They follow the steps to making a CSS file with PHP - generate the header and output the CSS - as well as examples of its usage. They create a range of colors based around a central one, five levels in either direction. The file they've created to accomplish this is also available for download.

0 comments voice your opinion now!
css colors helper tutorial header range palette css colors helper tutorial header range palette



Community Events





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


release artisanfiles series composer podcast symfony community interview security library framework language opinion list voicesoftheelephpant tool introduction laravel conference version

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