News Feed
Sections




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

Mikko Koppanen's Blog:
Padding thumbnail with color
January 11, 2008 @ 12:05:00

Mikko Koppanen has another image tutorial posted to his blog today - this time the focus is on padding a thumbnail with the color of your choice automatically.

Today's example originates from a question asked by a user. How do I thumbnail the image inside given dimensions proportionally and fill the "blank" areas with a color? Well, the answer is here.

His code pulls in the source image, generates a thumbnail from it and makes a new image (the background) that's a bit bigger than the thumbnail. From there, the thumbnail is laid on top and the whole thing is output as another PNG. An example of the input and output image is included.

0 comments voice your opinion now!
imagick padding thumbnail color example imagick padding thumbnail color example


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Consuming WebThumb's API in PHP

Alexey Zakhlestin's Blog: PHP+SCGI part 2: problem with eZComponents

WebReference.com: How To Create Alternating Row Colors in PHP

David Goodwin's Blog: Using SOAP and XmlRpc with PHP5 (a newbies findings)

Mikko Koppanen's Blog: Padding thumbnail with color


Community Events

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


voicesoftheelephpant xdebug install unittest extension api framework language interview opinion library series version podcast laravel release php7 community introduction example

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