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 6382663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:33:08+00:00 2026-05-25T02:33:08+00:00

How to reduce image sizes in Linux. I have used ImageMagick for this. But

  • 0

How to reduce image sizes in Linux. I have used ImageMagick for this. But it is not working well for gif images. I have used it as:

To resize image

exec("convert $original -resize " . $width . 'x' . $height . ' ' . $destination);

To reduce image size

exec("convert $original -quality 80% $new_img");

Please let me know if you have any way to reduce image size. This code works well for jpg, but not works well for gif images.

Appreciate your help.

  • 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-25T02:33:09+00:00Added an answer on May 25, 2026 at 2:33 am

    Quoting from the Imagemagick manual:

    -quality value 
    JPEG/MIFF/PNG compression level.
    

    That means that using the quality level will only work on the aforementioned image types, which do not include GIF.

    For GIF’s your easiest option is to use the -colors command to reduce the number of colors used in your image. The quality of the result depends very much on what your initial image contains, I have seen cases where a reduction from 256 to 16 colors did not cause significant quality loss, and others where a reduction to 128 colors rendered the image unusable. You’ll have to experiment.

    A last remark: you could transform your GIF to PNG format and use the -quality command on the resulting image. Quality on PNG’s however is a bit of a misnomer:

    For the MNG and PNG image formats, the quality value sets the zlib compression
    level (quality / 10) and filter-type (quality % 10). The default PNG “quality”
    is 75, which means compression level 7 with adaptive PNG filtering, unless the
    image has a color map, in which case it means compression level 7 with no PNG
    filtering.

    So don’t be surprised if the size reduction is less on PNG’s than on JPG’, it only improves compression of the lossless PNG image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a .NET application to reduce image file sizes using ImageMagick
i download many images form server,some images show well,but other not show: my key
in my app, i have large images, i display it in an image view
I am using ImageMagick to programmatically reduce the size of a PNG image by
Apologies for any ignorance, but I have never worked with jpeg images (let alone
I have integrated galeria to show images in my cakephp application.It works fine.But after
this link contains some tutorials for image processing and is useful for me, but
I have several .png images ( ETA: but the format could also be JPEG
In my activity i have to show some images. I used gridview in my
I'm trying to write a method to reduce the size of any image 50%

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.