• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

jpegtran for image optimization

by admin

jpegtran is a libjpeg command-line utility. It allows you to manipulate JPEG files, but its most useful function is optimization.

Installation of jpegtran

For Linux, this utility is usually found in packages:

# apt-get install libjpeg-progs

Usage

For the basic version of optimization, we call the command:

# jpegtran -copy none -optimize -outfile min.image.jpg image.jpg

The abobe command saves the optimized copy to min.image.jpg

-copy none removes all metadata from the source file.
-optimize optimizes image.

Progressive

To change the format to progressive, use the following command:

# jpegtran -progressive -copy none -optimize -outfile min.pro.image.jpg image.jpg

The above command saves the result to the min.pro.image.jpg file.

Quality change

You can also specify the compression ratio to visually select the best value:

# jpegtran -quality 80 -copy none -optimize -outfile min.pro.image.jpg image.jpg

Try different values from 5 to 95.

Filed Under: Linux

Some more articles you might also be interested in …

  1. genid Command Examples in Linux
  2. Linux OS Service ‘httpd’
  3. brotli: Compress/uncompress files with Brotli compression
  4. “docker secrete” Command Examples
  5. numlockx Command Examples in Linux
  6. “sudo: /etc/sudoers is world writable” – How to correct the permissions of sudoers file
  7. dbus-daemon Command Examples in Linux
  8. How to use Exit Codes in Conditional Statements in Shell Scripts
  9. nsenter: command not found
  10. How to Schedule Jobs with ‘at’ command under Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright