ahtesham/blueprint-image-php

A native PHP image generator using JSON blueprints (Satori-like for PHP)

Maintainers

Package info

github.com/ahtesham-clcbws/blueprint-image-php

pkg:composer/ahtesham/blueprint-image-php

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-04-09 10:48 UTC

This package is auto-updated.

Last update: 2026-04-09 10:49:57 UTC


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
Operational Monitor Report Card

🚀 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

🛡️ 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.