Excellent advice, thanks.  I was using GD 1.6.2 :( so will sort this and try
again.

Mick

-----Original Message-----
From: Richard Archer [mailto:[EMAIL PROTECTED]]
Sent: 15 April 2002 22:58
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Poor results with GD


At 5:32 PM +0200 15/4/02, Sear, Mick wrote:

>Not sure if anyone else uses GD much, but I've been experimenting with it
>and PHP recently and I've found I get large file sizes and very 'aliased'
>graphics.

gd is the correct tool for your job. But there are some caveats.

You will need to be using gd-2.0 or better to get satisfactory results
for this sort of work. gd-2.0.1 supports:
bicubic interpolation for scaling images
24-bit (true colour) images

Make sure your images aren't being converted to 8-bit at any stage of
the scaling/cropping process. Use ImageCreateTrueColor to create images.

Oh, and there's a bug in either php-4.1.2 or gd-2.0.1 where scaling
and cropping with one operation using imagecopyresampled fails.
I use a work-around of cropping with imagecopyresized and then scaling
with imagecopyresampled.

The large file sizes could be improved by reducing the quality of the
JPEG compression. Also, once the images have been scaled smoothly,
there will be fewer sharp edges allowing JPEG compression to be more
efficient.

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to