:green_book: -> :blue_book: Change color of png keep alpha channel in php!
Change color of an image without lose alpha channel (alpha layer)
Altere a cor da sua imagem sem perder a camada alpha (camada de transparĂȘncia)
You can change the color of this car (Or any imagem you want), example:
Change color from red color pick by Hexadecimal to blue:
<?php
require_once 'vendor/autoload.php';
use Colorizzar\ChangeColor;
$changeColor = new ChangeColor('red_car.png');
//From Red Hexadecimal
$changeColor->setFromHex('#FF1F28');
// Will create 'blue.png' in new_cars/ folder
$changeColor->colorizeByNameColor('Blue', 'new_cars/');
Or create by specific color name, example from red to blue:
<?php
require_once 'vendor/autoload.php';
use Colorizzar\ChangeColor;
$changeColor = new ChangeColor('red_car.png');
//From Red Hexadecimal
$changeColor->setFromHex('#FF1F28');
$changeColor->setToHex('#1F75FE');
// Will create 'blue.png' in new_cars/ folder
$changeColor->colorizeKeepAplhaChannnel('new_cars/blue.png');
Result of colorizeKeepAplhaChannnel()
/colorizeByNameColor()
:
Create all 135
COLORS with colorizeToAllColors()
!
Example of code:
<?php
....
$changeColor = new ChangeColor('red_car.png');
$changeColor->setFromHex('#FF1F28');
$changeColor->colorizeToAllColors('cars/');
ColorizzarWebService.php
) Create a WebService recive a file and manipulate methods to create dynamicJS-Plugin will consume ColorizzarWebService.php and show final result to user like a magic!
Read:
https://github.com/gabrieldarezzo/colorizzar/blob/master/CONTRIBUTING.md