| Recommend this page to a friend! | 
|  Download | 
| Info | Documentation |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 58 | All time:  10,551 This week: 206  | ||||
| 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 (22) | 
| 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 (22) | / | 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 (22) | / | 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 (22) | / | tests | 
| File | Role | Description | 
|---|---|---|
|  images.json | Data | Auxiliary data | 
|  RenderTest.php | Class | Class source | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
| 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.
 If you know an application of this package, send a message to the author to add a link here.