Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How to use the Linux command compress JPEG images     - How to build Mono 3.4.0 / 3.4.1 on Windows (Linux)

- Ubuntu achieve initialization iptables (Linux)

- Construction of Android and iOS apps use Jenkins Automation (Programming)

- Linux boot process and run level (Linux)

- Linux Fundamentals of the text, data flow processing orders (Linux)

- Linux the best download manager uGet (Linux)

- Linux network security probing tools Hping2 (Linux)

- Linux Mint 17 set up the Ruby environment (Linux)

- How to create a remote (Linux)

- A step by step teach have to install multi-node cluster configuration Hadoop (Server)

- Configuration OpenOCD + FT2232 under Ubuntu (Linux)

- Docker Basic Concepts (Linux)

- Android timer use (Programming)

- Linux performance optimization features Tuned and ktune (Linux)

- mysqldump MySQL command-line tool (Database)

- Struts2 Result Types (Programming)

- JQuery implements the same content merge cells (Programming)

- grub boot error resolution examples (Linux)

- Binary Packages Golang (Linux)

- vector C ++ sequence containers (Programming)

  How to use the Linux command compress JPEG images
  Add Date : 2018-11-21      
  Question: I have many digital cameras take photographs. I think before uploading to Dropbox, optimization and compression JPEG image. Is there any simple way to compress JPEG picture is not the loss of their quality?

Today photographing devices (such as smart phones, digital cameras) to shoot out of the picture resolution is growing. Even 36.3 million pixel Nikon D800 has been into the market, and this trend simply can not stop. Today, camera equipment and constantly improve the picture resolution, so we had to compress, and then upload it to have a storage limit, bandwidth limit of the cloud.

In fact, there is a very simple method here compressed JPEG image. One called "jpegoptim" command-line tool that can help you "lossless" beautification JPEG images, so you can compress JPEG pictures and without sacrificing their quality. In case your storage space and bandwidth budget is really very little, jpegoptim also supports "lossy" compression to adjust the image size.

Installation jpegoptim

Ubuntu, Debian or Linux Mint:

$ Sudo apt-get install jpegoptim

$ Sudo yum install jpegoptim
CentOS / RHEL installation, first open the EPEL repository, and then run the following command:

$ Sudo yum install jpegoptim
Lossless compression jpeg image

In order to losslessly compress a JPG image, use:

$ Jpegoptim photo.jpg
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 882178 -> 821064 bytes (6.93%), optimized.
Note that the original image is compressed image after covering.

If jpegoptim not lossless beautify the image, it will not cover:

$ Jpegoptim -v photo.jpg
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 821064 -> 821064 bytes (0.00%), skipped.
If you want to protect the original image, using the "-d" parameter indicates the save directory

$ Jpegoptim -d ./compressed photo.jpg
Thus, the compressed image will be saved in ./compressed directory (with the same input file name)

If you want to protect the file modification time to create, use "-p" parameter. Such compressed image will be the same as the original image date and time.

$ Jpegoptim -d ./compressed -p photo.jpg
If you just want to see lossless compression not really want to compress them, use the "-n" parameter to simulate the compression and then it will show the compression ratio.

$ Jpegoptim -n photo.jpg
Lossy compression JPG image

In case you really need to be saved in the cloud space, you can also use lossy JPG image.

In this case, use the "-m " option, mass range 0-100. (0 is the best quality, 100 is the worst quality)

For example, 50% of the quality of the compressed image:

$ Jpegoptim -m50 photo.jpg
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 882178 -> 301780 bytes (65.79%), optimized.
At the expense of the quality, you will get a smaller picture.

JPEG image compression more than once

The most common scenario is the need to compress multiple JPEG image files in a directory. To cope with this situation, you can use the following script.

#! / Bin / sh

# Compress all * .jpg files in the current directory
# Save ./compressed directory
# And the original file has the same modification date
for i in * .jpg; do jpegoptim -d ./compressed -p "$ i"; done
- Ubuntu dual-card system configuration method (Server)
- Getting the Linux shell expr use (Programming)
- Installation and configuration of phpMyAdmin under CentOS (Database)
- Deploy Mono 4 and Jexus 5.6 on CentOS7 (Server)
- PostgreSQL Stream Configuration (Database)
- Python format string (Programming)
- ssh port forwarding Comments (Server)
- Linux / Windows setup is complete port range (Linux)
- 10 useful tools for Linux users (Linux)
- Add local search to your Android app (Programming)
- installation of Vim plugin YouCompleteMe under Ubuntu 15.04 (Linux)
- MySQL 5.6 Open full query log (Database)
- Ubuntu 14.04 installed VirtualBox 4.3 appears vboxdrv: Unknown symbol mcount (Linux)
- To use Java arrays implement the order form (Programming)
- CentOS / Linux SWAP partitions added (Linux)
- The Linux disguised as windows to make the system more secure (Linux)
- Necessity in Java packages (Programming)
- Linux operating system to solve a serious fault handling (Linux)
- How to manage and use Logical Volume Management LVM in Ubuntu (Linux)
- Java inner classes (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.