PHP image workshop using GD library is very easy tool for manipulating the images. Main key features of this script is as follows,
- Cropping
- Filter
- Re sizing
- Rotating
- Writing
Usage is pretty simple :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
// We initialize a layer object which has the norway picture as a background // This layer will have the width and the height of the picture $norwayLayer = new ImageWorkshop( "imageFromPath" => "/path/to/images/norway.jpg" ); // We initialize another layer object which has the watermark as a background $watermarkLayer = new ImageWorkshop( "imageFromPath" => "/path/to/images/watermark.png" ); // Initialization of a document layer without specifying the path to an image. // It will have a transparent background, we need to specify its width and height $documentLayer = new ImageWorkshop(array( "width" => $norwayLayer->getWidth(), // Same width than $norwayLayer "height" => $norwayLayer->getHeight(), // Same height than $norwayLayer )); // Now, we will add the picture layer in the document stack (of sublayers) // We place $norwayLayer at the level 1 (just on the document background top) $documentLayer->addLayer(1, $norwayLayer); // $watermarkLayer must be on the top of $norwayLayer background (so level 2) ! // We choose the position from the document borders: // 12pixels from Left, 12pixels from Bottom ("LB") for example $documentLayer->addLayer(2, $watermarkLayer, 12, 12, "LB"); |
Requirement :- PHP with GD library
Demo & Download :- http://phpimageworkshop.com/
License :- GPL License
0 Comments Leave a comment