PHP thumbnail creation method creates low quality thumbnails

I am using the following method to create thumbnails of uploaded jpg images [see code below]. problem is, the quality of the thumbnails is sub-par. [see attached files].

Is there a way to specify the quality of the images as they are converted to thumbnails using php?

the attached files for reference all contain the following characteristics:
resolution: 72 dpi
color depth: 8 bits / channel

the files represent the following:

orginal.jpg = the original file before upload
phpthumb.jpg = the thumbnail version created by the php script attached
psdthumb.jpg = the thumbnail version created by photoshop with quality set to 100

Let me know if there is a way to increase the output quality of the thumbnail via the code i am using.
$new_width = 100; // Fix the width of the thumb nail images
 //$n_height=100; // Fix the height of the thumb nail imaage

 $tsrc = "uploads/thumbs/".$newname; // Path where thumb nail image will be stored

 $img = imagecreatefromjpeg("uploads/".$newname);
 $width = imagesx($img); // Original picture width is stored
 $height = imagesy($img); // Original picture height is stored
 $new_height = floor( $height * ( $new_width / $width ) );

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You could use instead of imagecopyresized which should have better quality (

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jsvb1977Author Commented:
thanks, i will check it out and report back with my success or failure -- and i apologize for the information on the sign. I did not think before i posted.
jsvb1977Author Commented:
perfect. thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.