RusAlex
RusAlex

Reputation: 8585

imagemagick jpeg conversion

guys , can anyone explain me why when im converting my jpeg into new file with command line:

convert -quality 80 file.jpg file2.jpg

File size is 20Kb

But if i open this file with Gimp and just save is as file2.jpg with quality 80, i have 10Kb size.

Upvotes: 1

Views: 955

Answers (2)

Sergio Fontenla
Sergio Fontenla

Reputation: 11

convert -quality 80 -type palette -strip -depth 8 file.jpg file2.jpg

This solve the problem and the file size is very similar to gimp or photoshop.

Upvotes: 1

mpenkov
mpenkov

Reputation: 21912

The quality scales used by imagemagick and GIMP are probably different. JPEG is a fairly complex format, and it has more parameters than one simple "quality" setting. For example, the type of chroma sub-sampling (4:2:0 vs 4:2:2, etc).

Here's what the GIMP documentation says about this:

The JPEG algorithm is quite complex, and involves a bewildering number of options, whose meaning is beyond the scope of this documentation. Unless you are a JPEG expert, the Quality parameter is probably the only one you will need to adjust.

This is likely to be true for other applications (such as PhotoShop, etc) as well.

Play around with some of the other parameters in both GIMP and imageMagick and it is likely that you will get similar results. If you post your image, then people may be more inclined to play around with it.

Upvotes: 1

Related Questions