Download the PHP package easygithdev/easygd without Composer
On this page you can find all versions of the php package easygithdev/easygd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download easygithdev/easygd
More information about easygithdev/easygd
Files in easygithdev/easygd
Package easygd
Short Description EasyGD - a PHP framework for use GD easier
License MIT
Informations about the package easygd
EasyGD
EasyGD is a PHP framework to use GD easier
The frame allows you to easily load images from a file, URL or string.
After loading the image, you can apply transformations.
You can then choose to save the result as a file, either to return a character string, or to send the image directly to the browser.
Installing
Installation is quite typical - with composer:
The header script
You will need to include the autoloader before using the classes.
The basic stuff
In all the examples that follow, the $stream variable is either a URL or a file or a character string.
For example, you can use the PHP logo with the following URL:
How to load and show an image
In this case, the stream is directly sent to the browser.
How to load and render an image in a HTML tag
You can use the data src property to render the image in the HTML tag.
Use it only on small image, if you dont want that your HTML page becommes to big.
How to load and save an image on disk
In this case, the stream is saved to the browser.
How to load, save and show an image in the same time
How to make multiple save
The other types
Define a dimension
Define a color
Define a position
Define a text
Create your own images
How to create a truetype image
Adding text in the images
How to draw a text into an image
How to draw a string vertically into an image
How to apply an alpha color to a text into an image
How to mix "GD text", "TrueType text", "FreeType text" into an image
Get the informations
How to get the information about an image
How to have the preseted positions
It will return an object Position ...
How to get / add the IPTC tag
Remember IPTC work with JPEG files.
Resizing the images
How to resize an image
How to resize an image by fixing the width or height
How to safetly resize an image
How to make a thumbnail
Croping and Rotation
How to crop an image
How to make a rotation
Merging two images
How to insert a logo into an image
Make thumbnails
Here you can find an example to, easyly, generate some thumbnails.
Filters
Using all the filters with the factory
You can use filters with a common syntax. The factory, use the three types of filters :
- FILTER_PRESET
- FILTER_LOOKUPTABLE
- FILTER_CONVOLUTION
You ca use this way to call, preset/convolution/lookuptable filters like this :
Using the preset filter
You can use :
- PRESET_NEGATE
- PRESET_GRAYSCALE
- PRESET_EDGEDETECT
- PRESET_EMBOSS
- PRESET_GAUSSIAN_BLUR
- PRESET_MEAN_REMOVAL
- PRESET_SELECTIVE_BLUR
- PRESET_PIXELATE
- PRESET_SMOOTH
- PRESET_CONTRAST
- PRESET_BRIGHTNESS
- PRESET_COLORIZE
How to create and apply a preset filter
Using the convolution filter
You can use preseted convolution or your own convolution filters.
How to use a preseted convolution
How to use your own convolution
Using the lookuptable filter
You can use preseted lookuptable or your own lookuptable filters.
How to use a preseted lookuptable
To create a new lookuptable filter, you must create a callback method like this :
License
This project is licensed under the MIT License - see the LICENSE file for details