dev-master
9999999-dev https://github.com/jlaso/gd-wrapperA GD wrapper
MIT
The Requires
- php >=5.6
image gd graphics
1.2
1.2.0.0 https://github.com/jlaso/gd-wrapperA GD wrapper
MIT
The Requires
- php >=5.6
image gd graphics
Wallogit.com
2017 © Pedro Peláez
A GD wrapper
image wrapper for PHP GD image, (*1)
I created this package with the only intention to write compact and understandable scripts., (*2)
The idea is to use this:, (*3)
$image = new Image(800, 600);
$image
->createColor('black', new Color(['R' => 0, 'G' => 0, 'B' => 0]))
->createColor('white', new Color(['R' => 255, 'G' => 255, 'B' => 255]))
->setColor('black')
->fill()
->setColor('white')
->fill(new Ellipse(new Point(400, 300), 200, 150))
->setColor('black')
->fill(new Circle(new Point(400, 300), 100))
->setColor('white')
->fill(new Circle(new Point(400, 300), 30))
->saveAsPng('/tmp/eye.png');
Instead of this:, (*4)
$image = imagecreate(800, 600); $black = imagecolorallocate($image, 0, 0, 0); $white = imagecolorallocate($image, 255, 255, 255); imagefill($image, 0, 0, $black); imagefilledellipse($image, 400, 300, 200, 150, $white); imagefilledellipse($image, 400, 300, 100, 100, $black); imagefilledellipse($image, 400, 300, 30, 30, $white); imagepng($image, '/tmp/eye.png');
Example to write ellipses and circles:, (*5)
php sample-eye.php && open /tmp/eye.png
, (*6)
Example to write polygons:, (*7)
php sample-penta.php && open /tmp/penta.png
, (*8)
Example to write text: take a look over sample-text.php, (*9)
php sample-text.php && open /tmp/text.png
, (*10)
Example to use palette:, (*11)
php sample-palette.php && open /tmp/palette.png
, (*12)
Internal palettes had been imported from Jam3/nice-color-palettes, (*13)
, (*14)
How to edit this file, (*15)
A GD wrapper
MIT
image gd graphics
A GD wrapper
MIT
image gd graphics