Optimizing JPEG Images

Submitted by leopathu on Sun, 05/08/2022 - 02:39
linux

JPEG is a lossy format, which means you lose information every time you save it, even if you choose 100% Quality, But all the JPEG images have some information (comments/Meta) data within it without losslessly. A tool does this magic is called JPEGTran and is likely already have an UNIX/Linux , If not see how to install it in linux and windows exe file here.

So optimize the JPEG information without losslessly with removing meta information and comments, The following command would do the magic,

# strip meta and optimize

$ jpegtran -copy none source.jpg > destination.jpg

# strip meta and convert to progressive coding

$ jpegtran -copy none -progressive source.jpg > destination.jpg

# keep all meta but still optimize

$ jpegtran -copy all source.jpg > destination.jpg

Tags