Git Product home page Git Product logo

colorizzar's Introduction

Build Status Version Total Downloads

Colorizzar

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() :

Scheme


Create all 135 COLORS with colorizeToAllColors() !

Example of code:

<?php
....

$changeColor = new ChangeColor('red_car.png');
$changeColor->setFromHex('#FF1F28');
$changeColor->colorizeToAllColors('cars/');

Scheme

TODO-LIST:

  • FIX (ChangeColorTests.php:testColorizeLoopColors())
  • FIX require_once() on tests, (Maybe a custom vendor.php for tests)
  • Create a plugin in JS consume colorizzar and show in realtime result
  • Improve tests (check in image created has new rgb expected)
  • (almost done -> ColorizzarWebService.php) Create a WebService recive a file and manipulate methods to create dynamic
  • (done) IMPROVE TODOLIST and update readme with new methods (hexadecimal)
  • (done) Add DockBlock in all methods
  • (done) Improve ChangeColor.php SOLID
  • testExtensionIsFilePng()

ColorizzarWebService.php will be:

  • Hash create by upload image
  • create a folder with same name of hash
  • result a JSON with all urls created

JS-Plugin will consume ColorizzarWebService.php and show final result to user like a magic!

Helpfull links

How Contribute

Read:
https://github.com/gabrieldarezzo/colorizzar/blob/master/CONTRIBUTING.md

Thanks to:

colorizzar's People

Contributors

augustohp avatar hevertoncastro avatar juniornunes7 avatar peter279k avatar preetender avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

colorizzar's Issues

Soft Edges Problem

In your script, the color is only replaced if it matches the color 100%.
How can I get all pixels in the color area to be replaced?
Unfortunately, the pictures have "soft edges".

Example:

$changeColor-> setFromHex ('# 04fe04');
$changeColor-&gt; setToHex ($ _ POST ["color1"]);

Replaced all colors that belong to "green".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.