Archive for the 'images' Category

Installing pngcrush at dreamhost

Sep 4th, 2008

pngcrush is an excellent optimizer for png images, simple and fast, highly recommended. Basically any time before you post a PNG on the web, you should run it through PNGCrush. It’s a command line utility, there’s a quick way to integrate pngcrush in windows explorer. (note to self: I actually wrote a wordpress plugin to […]

 

Image optimization – 7 mistakes

Jun 26th, 2008

The slides from my talk at the Velocity conference » Download | View | Upload your own

 

Load a photo in a canvas, then flip

May 3rd, 2008

Today our family went to the yearly photo session with the girls. We took one shot that can be looked normally, as well as upside down, so I was wondering can you flip an image using a canvas tag. Turns out, yes, you can and it’s pretty easy. » Demo is here. How to load […]

 

Canvas pie with tooltips

Mar 8th, 2008

This is very flattering: Greg Houston took my script for DIY canvas pie and added tooltips and better colors logic. Here’s the result, it’s really nice, built with some MooTools. The tooltips are not supported in <canvas> but Creg used an image that overlays the pie and set the tooltips with an image map. Clever, […]

 

YUI pie chart example

Jan 16th, 2008

If case you haven’t noticed – YUI Charts hit the streets. As with everything new, it’s best shown and understood by example. So here’s the simplest example of using a pie chart. Basically I took the example from the YUI page, changed all the paths to point to yahooapis.com (where YUI is hosted for free) […]

 

Image fun with PHP – part 2

Nov 13th, 2007

This post is a demo of what the imagefilter() PHP function can do for you. The Original imagefilter() called with different filter constants Filter: IMG_FILTER_BRIGHTNESSCode to reproduce: <?php $image = imagecreatefrompng(‘nathalie.png’); imagefilter($image, IMG_FILTER_BRIGHTNESS, 5); imagepng($image, ‘img_filter_brightness_5.png’); imagedestroy($image); ?> Filter: IMG_FILTER_BRIGHTNESSCode to reproduce: <?php $image = imagecreatefrompng(‘nathalie.png’); imagefilter($image, IMG_FILTER_BRIGHTNESS, 50); imagepng($image, ‘img_filter_brightness_50.png’); imagedestroy($image); ?> Filter: IMG_FILTER_BRIGHTNESSCode to reproduce: <?php $image = imagecreatefrompng(‘nathalie.png’); imagefilter($image, IMG_FILTER_BRIGHTNESS, 100); imagepng($image, ‘img_filter_brightness_100.png’); imagedestroy($image); […]

 

Image_Text 0.6 beta is out

Apr 19th, 2007

» Download here This is my first PEAR release and I was actually surprised how easy it is to package and roll out a release. So you have your local copy of the CVS repository that contains the scripts you want to release as part of the package. In order to release, you need package.xml, […]

 

Laziest image resize in PHP

Dec 13th, 2006

Today I saw a post at digg.com on image resizing with PHP and there was quite a discussion. Let me share the laziest way (that I know of) how to do it – PEAR::Image_Transform is all it takes. Here goes: <?php require_once ‘Image/Transform.php’; $i =& Image_Transform::factory(”); $i->load(‘test.jpg’); $i->fit(100,100); $i->save(‘resized.png’, ‘png’); ?> In addition, the Image_Transform […]