Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog (1) | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2021-06-18 (2 months ago) ![]() | Not yet rated by the users | Total: 48 | All time: 10,096 This week: 200![]() |
Version | License | PHP version | Categories | |||
blockies 1.0 | Custom (specified... | 5 | Algorithms, PHP 5, Graphics |
Description | Author | |
This package can generate blocky images from a given seed string. Innovation Award
|
The php alternative for download13/blockies js package.
$blockies = new \IsaEken\Blockies\Blockies;
$blockies->draw();
echo $blockies->svg(); // <svg...
$blockies->image()->save('image.jpg'); // save generated image
echo $blockies->image()->encode('data-url')->encoded; // data:image/png;base64...
You can install with using composer.
composer require isaeken/blockies
Create the instance first.
$blockies = new \IsaEken\Blockies\Blockies([
'seed' => '130ef2f0a8b713',
'size' => 64,
'background' => \Spatie\Color\Hex::fromString('#ff0000')->toHsl(),
]);
// or
$blockies = new \IsaEken\Blockies\Blockies;
draw them.
$blockies->draw();
You can use this as SVG.
file_put_contents('image.svg', $blockies->svg());
or use this with Intervention\Image
$blockies->image()->greyscale()->save('black_and_white.jpg');
recreate your seed
$blockies->refresh();
$blockies->image(); // this is a new image.
resize and change background
$blockies
->setSize(120)
->setBackground(\Spatie\Color\Hex::fromString('#00ff00')->toHsl())
->draw()
->image();
change seed
$blockies->setSeed('130ef2f0a8b713')->draw()->image();
get values
$blockies->getSeed(); // string
$blockies->getBackground(); // \Spatie\Color\Hsl
$blockies->getSize(); // int
composer test
The MIT License (MIT). Please see License File for more information.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
||||
![]() |
Data | Auxiliary data | ||
![]() |
Lic. | License text | ||
![]() |
Data | Auxiliary data | ||
![]() |
Doc. | Documentation |
![]() |
/ | images |
File | Role | Description |
---|---|---|
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
Icon | Icon image |
![]() |
/ | src |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
/ | tests |
File | Role | Description |
---|---|---|
![]() |
Data | Auxiliary data |
![]() |
Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.