Download the PHP package gblix/gfx-php without Composer
On this page you can find all versions of the php package gblix/gfx-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gblix/gfx-php
More information about gblix/gfx-php
Files in gblix/gfx-php
Package gfx-php
Short Description The pure PHP graphics library
License LGPL-2.1-or-later
Homepage https://github.com/GBLIX/gfx-php
Informations about the package gfx-php
gblix/gfx-php — The pure PHP graphics library
This is the GBLIX fork of mike42/gfx-php. The upstream repository is no longer actively maintained. This fork targets PHP 8.2+ and is available as
gblix/gfx-phpon Packagist.
This library implements input, output and processing of raster images in pure PHP, so that image processing extensions (Gd, Imagick) are not required.
This allows developers to eliminate some portability issues from their applications.
Features
- Format support includes PNG, GIF, BMP and the Netpbm formats.
- Support for scaling, cropping, format conversion and colorspace transformations.
- Pure PHP: This library does not require Gd, ImageMagick or GraphicsMagick extensions.
v1.0.0 changelog
- Requires PHP 8.2+ (previously PHP 7.0+)
- Full property type declarations across all classes
- Full method return type declarations
- Fixed implicit nullable parameter deprecations (PHP 8.1)
- Fixed dynamic property deprecations (PHP 8.2)
- Fixed
PngHeader::getCompresssion()reading an undeclared property ($this->compresssion→$this->compression) - Replaced deprecated string pseudo-callables with first-class callable syntax
- PHPUnit upgraded to
^11 - Removed
composer.lock(library policy) - Docker support added
Quick start
Requirements
- PHP 8.2 or newer
zlibextension, for reading PNG files
Installation
Install gblix/gfx-php with Composer:
Basic usage
Testing
All test commands run inside Docker — no local PHP installation required.
Build the image once:
Run all PHPUnit tests (unit + integration):
Run only the unit tests:
Run only the integration tests (reads real image files from test/resources/):
Run benchmarks (PHPBench, scale/convert/codec operations):
Test layout
| Path | What it covers |
|---|---|
test/unit/ |
Individual classes (image operations, LZW codec, format en/decoders) |
test/integration/ |
Round-trip reads of real image files (BMP Suite, PyGIF, pngsuite) |
test/benchmark/ |
PHPBench benchmarks for scale, convert and codec operations |
Further reading
- See the
example/sub-folder for snippets. - Source: https://github.com/GBLIX/gfx-php
Contributing
This project is open to all kinds of contributions, including suggestions, documentation fixes, examples, formats and image processing algorithms.
See the issue tracker. Code contributions must be releasable under LGPL-2.1-or-later.
Scope
As a small project, we can't do everything. In particular, gfx-php is not likely to ever perform non-raster operations:
- vector image formats (PDF, SVG, EPS, etc).
- anything involving vector fonts
Acknowledgements
This repository uses test files from other projects:
Similar projects
- Imagine, which wraps available libraries.