New on Srapsware

How to Optimize and Compress JPEG or PNG Images in Linux Command line

How to Optimize and Compress JPEG or PNG Images in Linux Command line

You have a lot of images, and want to optimize and compress the images without losing its original quality before uploading them to any cloud or local storages? There are plenty of GUI applications available which will help you to optimize the images. However, here are two simple command line utilities to optimize images and they are:

  1. jpegoptim – is a utility to optimize/compress JPEG files without losing quality.
  2. OptiPNG – is a small program that optimize PNG images to smaller size without losing any information.

Using these two tools, you can either optimize a single or multiple images at a time.

Install jpegoptim in Linux

Install OptiPNG in Linux

Note: yum command is mostly used by centos, so please find insternative installer that work on your OS.

How to use Jpegoptim recursively:

How to use optipng recursively:

WarningDon’t run uses optimization command as root otherwise it will change files permission. so run as only as your by your hosting user account login or public file access permission user.

Leverage Browser Caching for Windows Servers-IIS

No Comments

Post A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Excited? Let’s Talk

You’re Our First Priority. Rest all can wait.