Re: poor image quality in php
| From: | Jim Grill | Date: | Mon, 27 Sep 2004 21:45:24 +0000 |
| Subject: | Re: poor image quality in php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198023@lists.php.net to get a copy of this message | ||
> hi!
> I have a problem with the imagejpeg() function - or related. I must
specify
> that I'm a newbie with image handling with php and that a piece of advice
> would really help me right now.
> The deal is that I want to create a (smaller) resized copy of a certain
> image using this code:
>
> $veche = imagecreatefromjpeg($img_large);
> $noua = imagecreate($wm, $hm);
> imageinterlace($noua, 1);
> imageinterlace($veche, 1);
> imagecopyresized($noua, $veche, 0, 0, 0, 0, $wm, $hm, $size_large[0],
> $size_large[1]);
> imagejpeg($noua, $smallPath, 100);
> ImageDestroy($veche);
> ImageDestroy($noua);
>
> the resizing part goes well; I don't really know what the imageinterlace
> function does, but I used it in desperation. Why: the output image's
quality
> is visibly inferior to the source's. And I want the image to look good.
The
> source is a jpeg (dinamic). As you probably have noticed, I set the
quality
> parameter to 100, but uselessly.
> What i'd like to know is whether php can output some quality jpegs, and if
> so, then how?
> Thanks a lot!
> PS: imagecopyresampled does not work either - produces the same result!
>
When you create the new image try using imagecreatetruecolor()
http://us2.php.net/manual/en/function.imagecreatetruecolor.php
JIm Grill