定制 gabrieldarezzo/colorizzar 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gabrieldarezzo/colorizzar

最新稳定版本:1.0.0

Composer 安装命令:

composer require gabrieldarezzo/colorizzar

包简介

Change the colors of an image without lose alpha channnel

README 文档

README

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:

统计信息

  • 总下载量: 3.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 27
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 27
  • Watchers: 0
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-20