ahtesham / blueprint-image-php
A native PHP image generator using JSON blueprints (Satori-like for PHP)
Package info
github.com/ahtesham-clcbws/blueprint-image-php
pkg:composer/ahtesham/blueprint-image-php
Requires
- php: ^8.1
- ext-gd: *
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- phpunit/phpunit: ^10.0
README
Universal JSON-to-Static-UI Engine.
Render high-fidelity, premium image reports using a familiar flexbox-like JSON schema. No headless browsers, no Puppeteer—just pure, high-performance PHP GD.
🖼️ High-Fidelity Gallery
| Operational Monitoring | Student Report Cards |
|---|---|
![]() |
![]() |
🚀 Why Blueprint Image?
Most image generation libraries either require heavy headless browsers or force you to manually calculate X/Y coordinates for every element. Blueprint Image solves this by providing:
- Two-Pass Reflow Layout Engine: Automatic measurement and arrangement of nested elements.
- Intrinsic Sizing: Containers automatically grow to fit their content.
- Fluid Layouts: Auto-expanding canvas height and multi-line text wrapping.
- Pure PHP GD: High performance, shared-hosting compatible, no external dependencies.
- Universal Schema: Uses the exact same JSON format as modern Satori/HTML-to-SVG engines.
📦 Installation
Install via Composer:
composer require ahtesham/blueprint-image-php
🛠️ Quick Start
1. Simple Rendering from PHP Array
use Ahtesham\BlueprintImage\BlueprintImage; $blueprint = [ 'width' => 600, 'layout' => [ 'type' => 'div', 'props' => [ 'style' => [ 'backgroundColor' => '#1e293b', 'padding' => 40, 'borderRadius' => 20 ], 'children' => 'Hello from Blueprint Image!' ] ] ]; BlueprintImage::make($blueprint)->save('hello_world.png');
2. Loading from JSON
BlueprintImage::make()->loadJson($jsonString)->save('report.png');
📘 Documentation
- Blueprint Schema Guide — Comprehensive reference for styles and nodes.
- Fluid Layout & Wrapping — How to handle variable-length content.
- Laravel Integration — Facades, Service Providers, and best practices.
- Dynamic Report Generation — looping through data to build reports.
🛡️ License
The MIT License (MIT). Please see License File for more information.
🤝 Contributing
Authored by Ahtesham ahtesham2000@gmail.com for the Momin Scholar Program and Universal Branding.

