Can a resized image be of Photoshop quality?

This is a discussion on Can a resized image be of Photoshop quality? within the PHP Language forums, part of the PHP Programming Forums category; I have resized an image from 1024 x 768 to 800 x 600 with the following code: <?php $tmp_dir = $...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-14-2003
Keiron Waites
 
Posts: n/a
Default Can a resized image be of Photoshop quality?

I have resized an image from 1024 x 768 to 800 x 600 with the following
code:

<?php
$tmp_dir = $_FILES["image"]["tmp_name"];
move_uploaded_file($_FILES["image"]["tmp_name"], "c:/test/1.jpg");
$image = imageCreateFromJPEG("c:/test/1.jpg");
$new_image = imagecreatetruecolor(800, 600);
imagecopyresized($new_image, $image, 0, 0, 0, 0, 800, 600, 1024, 768);
imagejpeg($new_image,"c:/test/new/fuckyou.jpg");
?>

This does not create an image of a decent quality. Is it possible to resize
an image and have it look like a photoshop resized image?


Reply With Quote
  #2 (permalink)  
Old 10-14-2003
Luke Ross
 
Posts: n/a
Default Re: Can a resized image be of Photoshop quality?

Hi,

Keiron Waites wrote:
> I have resized an image from 1024 x 768 to 800 x 600 with the following
> code:
>
> <?php
> $tmp_dir = $_FILES["image"]["tmp_name"];
> move_uploaded_file($_FILES["image"]["tmp_name"], "c:/test/1.jpg");
> $image = imageCreateFromJPEG("c:/test/1.jpg");
> $new_image = imagecreatetruecolor(800, 600);
> imagecopyresized($new_image, $image, 0, 0, 0, 0, 800, 600, 1024, 768);
> imagejpeg($new_image,"c:/test/new/fuckyou.jpg");
> ?>
>
> This does not create an image of a decent quality. Is it possible to resize
> an image and have it look like a photoshop resized image?


Use imagecopyresampled(), or for even better results see some of the
contributed routines in the PHP manual (see the entry for
imagecopyresampled() and look through the user comments).

Regards,

Luke

Reply With Quote
  #3 (permalink)  
Old 10-14-2003
s a n j a y
 
Posts: n/a
Default Re: Can a resized image be of Photoshop quality?

int imagejpeg ( resource image [, string filename [, int quality]])

There is a third arg for imagejpeg() function, which is quality. Right now
you are using default value for it. try using a higher value like 90 or so.
It worked for me.

Hope this helps.

sanjay


"Keiron Waites" <webmaster@-NOSPAM-sharemonkey.com> wrote in message
news:bmgqp9$rrq$1@hercules.btinternet.com...
| I have resized an image from 1024 x 768 to 800 x 600 with the following
| code:
|
| <?php
| $tmp_dir = $_FILES["image"]["tmp_name"];
| move_uploaded_file($_FILES["image"]["tmp_name"], "c:/test/1.jpg");
| $image = imageCreateFromJPEG("c:/test/1.jpg");
| $new_image = imagecreatetruecolor(800, 600);
| imagecopyresized($new_image, $image, 0, 0, 0, 0, 800, 600, 1024, 768);
| imagejpeg($new_image,"c:/test/new/fuckyou.jpg");
| ?>
|
| This does not create an image of a decent quality. Is it possible to
resize
| an image and have it look like a photoshop resized image?
|
|


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:47 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0