Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6720709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:14:39+00:00 2026-05-26T09:14:39+00:00

In PHP, imagecreatefromjpeg() can optimize an image, as it saves the image with an

  • 0

In PHP, imagecreatefromjpeg() can optimize an image, as it saves the image with an appropriate quality for web. However, this is not the best option. I optimized again the php-generated image by Yahoo Smush and it optimized the image by a factor of 5-10%. This is not strange indeed; but alternatively I used http://www.imageoptimizer.net/ and it optimized my php-generated images by a factor of more than 50%.

This is indeed a significant improvement to save bandwidth and fast load of the webpages. I wonder what technology they use. They offer a windows-based application, but no description about their method.

Anyway, my question is how we can make a script (in php, perl, python, etc) to optimize to this extent?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:14:40+00:00Added an answer on May 26, 2026 at 9:14 am

    I don’t know anything about those algorithms involved for compressing and optimizing images, but i would believe, that they would get too slow, if implemented in pure PHP. I therefore would recommend using already available command-line tools and wrap them in a PHP class or script. Some of these tools are:

    • PNG: optipng, pngcrush
    • JPG: jpgcrush (i am unable to find any website for this)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Can anybody suggest the best image resize script in php? I'm still
I came up with this: <?php $dir = $_GET['dir']; header('Content-type: image/jpeg'); $create = imagecreatetruecolor(150,
Possible Duplicate: How can I merge 3 images into 1 image via PHP? How
<?php header('content-type:image/jpeg'); $image = imagecreatefromjpeg('suliduli.jpg'); //alpha channel parameter omitted below as it is optional.
in my php code, I get an image in a variable. e.g.: $src_image= imagecreatefromjpeg(my_jpeg_path);
I'm using this piece of php code to create and rotate an image. And
PHP, as we all know is very loosely typed. The language does not require
PHP treats all arrays as associative, so there aren't any built in functions. Can
PHP, for all its warts, is pretty good on this count. There's no difference
Possible Duplicate: How to resize an image using PHP? Here's what I've tried: $image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.