News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

CodeGeekz:
Cropping Images in PHP Based on their Entropy
February 03, 2014 @ 11:25:42

On the CodeGeekz site there's a new post showing you how to use the Imagick extension and a custom library to crop images based on their entropy (keeping the "busiest" part of the image).

The need to resize and crop images in order to create thumbs, is a very common scenario for most websites. For example a blog like this one uses images in the content of the posts, images which at some point are used to create a thumb for the homepage. In most cases, the thumb's dimensions are not dynamic but are static throughout the website in order to better fit the template. This however creates a major problem when we try to automatically resize and crop our images in the desired dimensions.

He starts with an example of the normal kind of cropping based on a given height and width. He points out an issue with "smart cropping" and resizing the image with the cropping is done. Instead, he's made use of Imagick in his library to produce a better cropped image based on the parts of the image with the most entropy.

0 comments voice your opinion now!
crop image entropy busy resize smart tutorial

Link: http://codegeekz.com/cropping-images-entrop/

blog comments powered by Disqus

Similar Posts

ZendCasts.com: Unit Testing Action Helpers

php|architect: Zen(d) and the Art of Email

ZetaCode.com: PHP GTK tutorial

NETTUTS.com: Easy Development With CodeIgniter

DevShed: Unit Testing in Detail


Community Events





Don't see your event here?
Let us know!


list library introduction interview developer code application configure series language api podcast release wordpress threedevsandamaybe bugfix project laravel community framework

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework