PHP Classes

PNG Hex Color Modifier: Replaces a color in a PNG image by another color

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 160 All time: 8,971 This week: 524Up
Version License PHP version Categories
hexpng 1.1Custom (specified...5PHP 5, Graphics
Description 

Author

This class can replaces a color in a PNG image by another color.

It takes a given color and replaces it in PNG image by another color.

The class saves back the image PNG file and returns the changed image as a data URL.

Innovation Award
PHP Programming Innovation award winner
August 2016
Winner


Prize: One big elePHPant Plush Mascott
Sometimes you need to generate variants of the same image to present it in different colors.

PHP provides a good set of functions that you can use to manipulate images in any way you need. However some kinds of image processing can be very slow to run as PHP scripts.

This class provides a solution to create variants of a PNG image with a different background color, just by reading the PNG file contents and replacing a few bytes in the image file data directly.

Manuel Lemos
Picture of Bruno Henrique Ferreira de Oliveira
  Performance   Level  
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

 

Documentation

?=============PNG Hex Color Modifier=============

Introduction.

-Paint a png image by hex reflecting in the front.

-Overrides the Hex value of the main PNG image file and make it viewed for the web and S.O.

-The client-side changes are controlled by the javascript.

-Even when reloading the page, the color continues as the last modified because the image file was modified too.

Requirements.

-PHP 5;

Instalation.

-The test.png in the img directory is the PNG that will be modified.

-The main class is in the resources directory.

-The controller is the javascript and it is loaded by the home.html where are the radios buttons for the test.

-Bonus: JPG image HEX color modifier added (experimental stable release), download main image and set it in home.html.

To do.

-Add support for more colors.

License

-In the custom license file.


  Files folder image Files (13)  
File Role Description
Files folder imagedoc (3 files)
Files folder imageimg (2 files)
Files folder imagepublic (1 file, 2 directories)
Files folder imageresources (3 files)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 76%
Total:160
This week:0
All time:8,971
This week:524Up