RE: [PHP] Poor results with GD
| From: | Sear, Mick | Date: | Tue, 16 Apr 2002 08:08:54 +0000 |
| Subject: | RE: [PHP] Poor results with GD | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-93144@lists.php.net to get a copy of this message | ||
I'm currently setting JPEG quality to 85%, hence the large file sizes.
Normally, I'd be looking for better quality and file sizes about 70% of
their current size. Some of the originals are scanned directly from the
painting, which yields very high quality, some are taken with a digital
camera (I could live with poorer quality on these).
I'm using some functions I found in 'PHP and MySQL web development' with
some modifications, so JPEGs are generated from uploaded files and stored on
the server through an HTML form interface. Here's the core bit of the code:
$src = ImageCreateFromJPEG($image);
$dst = ImageCreate($tn_width,$tn_height);
ImageCopyResized($dst, $src, 0, 0, 0, 0,
$tn_width,$tn_height,$width,$height);
ImageJpeg($dst, $path, $compression); //compression set to 85 here.
ImageDestroy($src);
ImageDestroy($dst);
Mick
-----Original Message-----
From: Andrew Brampton [mailto:andrew@bramp.freeserve.co.uk]
Sent: 15 April 2002 17:56
To: Sear, Mick; php-general@lists.php.net
Subject: Re: [PHP] Poor results with GD
They looked ok to me, but I don't know what the orginals looked like.
But the problem might be that your JPeg quality is set lower than you would
like. You can increase it be setting a parameter in ImageJPEG() or most
likly whatever function you are using
Andrew
----- Original Message -----
From: "Sear, Mick" <msear@epson.co.uk>
To: <php-general@lists.php.net>
Sent: Monday, April 15, 2002 4:32 PM
Subject: [PHP] Poor results with GD
> 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.
>
> Can anyone suggest a fix/ alternative?
>
> You'll see what I mean if you look at www.msear.com/paintings/ where the
> images are currently all generated with GD (but not for long, I think!)
>
> Cheers,
> Mick
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>