Download the PHP package void/og-image without Composer
On this page you can find all versions of the php package void/og-image. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download void/og-image
More information about void/og-image
Files in void/og-image
Package og-image
Short Description A minimal Open Graph Image generator library
License MIT
Informations about the package og-image
OG Image
A standalone PHP library for generating dynamic Open Graph (OG) images, with optional Symfony bundle integration.
Overview
OG Image provides a flexible, extensible system to programmatically generate custom Open Graph images. Perfect for creating dynamic social media preview images with titles, descriptions, badges, and custom themes.
Works standalone or as a Symfony bundle - use it however you prefer!
Features
- 🎨 Customizable Themes - Define colors, backgrounds, and fonts
- 📐 Flexible Layout System - Built-in layouts and easy to extend
- 🏷️ Badge Support - Add category/status badges to your images
- 🔄 Multiple Formats - Render to WebP (default) or PNG
- 🚀 Simple API - Intuitive, functional approach with immediate rendering
- 🔌 Zero Dependencies - Core library has no external dependencies (except Intervention Image)
- 🎯 Standalone & Bundle - Use as a library or register as a Symfony bundle
Requirements
- PHP 8.2+
- Intervention Image 3.11+
- Image Driver: One of:
- GD (bundled with PHP, recommended)
- Imagick (optional, for better performance)
Optional (for Symfony integration):
- Symfony 7.4 or 8.0+
At least one image driver must be available. GD is included with most PHP installations by default.
Installation
Via Composer
Quick Start - Standalone
Quick Start - Symfony Bundle
Register the Bundle
Use in Your Application
Core Concepts
ImageContent
The data model for your OG image:
Theme
Customize the appearance of your images:
Background
Control how backgrounds are rendered:
Layouts
Built-in layouts for common patterns:
StandardLayout
The default layout with title, description, and badges:
Image Formats
Generate WebP or PNG images:
Extending
Custom Layouts
Create your own layout by extending AbstractLayout:
Custom Fonts
Use different fonts for various text elements:
Custom Badges
Add badges to your content:
Enums
The library includes helpful enums for configuration:
Format - Image output format:
Fit - Background image fitting:
TextAlignment - Text alignment within boxes:
Overflow - Text overflow handling:
Placement - Element positioning:
Complete Example
Testing
Run the test suite:
With coverage report:
License
MIT License - see LICENSE file for details
Author
Raphael Alogou - [email protected]