ImageMagick PHP Image Manipulation, Page 2
4. Brighten / Sharpen / Crop an Image in PHP
Need an alternative to Photoshop or another heavy software product for fine tuning your pictures? ImageMagick offers many of the same features in a lighter-weight utility. In this section, you are going to see how to brighten, sharpen and crop images in ImageMagick.
Here is the original image for the example.
The following command increases brightness by 120%.
convert kid.png -modulate 125% bright.jpg
The following command increases sharpness.
convert k2.png -unsharp 1.5×1.0+1.5+0.02 sharp.png
The following command crops an image.
convert k2.png -crop 150x150+30+10 crop.png
5. Frame an Image in PHP
I am sure you always wondered how Google's Picasa tool creates a cool collage of your images very quickly. Well, you can create the same effect using ImageMagick. See how I converted the original sample image to a cool bordered image.
The command to create this frame is also simple:
convert kid.png -bordercolor white -border 6 -bordercolor grey60 -border 1 -background none -rotate 6 -background black \( +clone -shadow 60x4+4+4 \) +swap -background none -flatten frame.png
Explore More ImageMagick Tricks
The article provided just a few examples of ImageMagick. You can explore more ImageMagick features on ImageMagicks's Usage page.
Page 2 of 2