Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (22) | Download .zip | 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.
Files |
File | Role | Description | ||
---|---|---|---|---|
images (12 files) | ||||
src (4 files) | ||||
tests (2 files) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE.md | Lic. | License text | ||
phpunit.xml.dist | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | images |
File | Role | Description |
---|---|---|
1.jpeg | Icon | Icon image |
10.jpeg | Icon | Icon image |
11.jpeg | Icon | Icon image |
12.jpeg | Icon | Icon image |
2.jpeg | Icon | Icon image |
3.jpeg | Icon | Icon image |
4.jpeg | Icon | Icon image |
5.jpeg | Icon | Icon image |
6.jpeg | Icon | Icon image |
7.jpeg | Icon | Icon image |
8.jpeg | Icon | Icon image |
9.jpeg | Icon | Icon image |
Files | / | src |
File | Role | Description |
---|---|---|
Blockies.php | Class | Class source |
Helpers.php | Class | Class source |
Options.php | Class | Class source |
Rectangle.php | Class | Class source |
Files | / | tests |
File | Role | Description |
---|---|---|
images.json | Data | Auxiliary data |
RenderTest.php | 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.