Skip to content

evokelektrique/orenji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍊 Orenji - オレンジ

(Under development)

This is a modified version of mosaic-generator, all credits to the owner.

Public API

use Orenji\Convert;
use Orenji\Utils;

// Convert Hex colors to RGB
$convert = new Convert();
$black = $convert::hex_to_rgb("#000000");
$grey = $convert::hex_to_rgb("#808080");
$grey_dark = $convert::hex_to_rgb("#0a0a0a");

// Find the distance between colors,
// Smaller numbers means more similarity.
$black_grey_distance = Utils::distance($black, $grey); // => 192.33...
$black_grey_distance = Utils::distance($black, $grey_dark); // => 170

// Prepare mosaic images
$files = [];
$target = "./target.jpg";
$tile_size = 50;
$image = new Image($target, $files, $tile_size);

Releases

No releases published

Languages