Skip to content

Commit

Permalink
cjpeg: Adjust claims RE: image quality settings
Browse files Browse the repository at this point in the history
Quality values > 95 are not useless.  They just may not provide as good
of a size vs. perceptual quality tradeoff as lower quality values.  This
also displays the default quality value in the cjpeg usage.

Closes libjpeg-turbo#39
  • Loading branch information
dcommander committed Dec 17, 2015
1 parent d70a5c1 commit 6fa5ebd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
15 changes: 7 additions & 8 deletions cjpeg.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH CJPEG 1 "21 November 2014"
.TH CJPEG 1 "17 December 2015"
.SH NAME
cjpeg \- compress an image file to a JPEG file
.SH SYNOPSIS
Expand Down Expand Up @@ -85,20 +85,19 @@ reconstructed image: the higher the quality setting, the larger the JPEG file,
and the closer the output image will be to the original input. Normally you
want to use the lowest quality setting (smallest file) that decompresses into
something visually indistinguishable from the original image. For this
purpose the quality setting should be between 50 and 95; the default of 75 is
often about right. If you see defects at
purpose the quality setting should generally be between 50 and 95 (the default
is 75) for photographic images. If you see defects at
.B \-quality
75, then go up 5 or 10 counts at a time until you are happy with the output
image. (The optimal setting will vary from one image to another.)
.PP
.B \-quality
100 will generate a quantization table of all 1's, minimizing loss in the
quantization step (but there is still information loss in subsampling, as well
as roundoff error). This setting is mainly of interest for experimental
purposes. Quality values above about 95 are
.B not
recommended for normal use; the compressed file size goes up dramatically for
hardly any gain in output image quality.
as roundoff error.) For most images, specifying a quality value above
about 95 will increase the size of the compressed file dramatically, and while
the quality gain from these higher quality values is measurable (using metrics
such as PSNR or SSIM), it is rarely perceivable by human vision.
.PP
In the other direction, quality values below 50 will produce very small files
of low image quality. Settings around 5 to 10 might be useful in preparing an
Expand Down
3 changes: 2 additions & 1 deletion cjpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ usage (void)
#endif

fprintf(stderr, "Switches (names may be abbreviated):\n");
fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is useful range)\n");
fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is most useful range,\n");
fprintf(stderr, " default is 75)\n");
fprintf(stderr, " -grayscale Create monochrome JPEG file\n");
fprintf(stderr, " -rgb Create RGB JPEG file\n");
#ifdef ENTROPY_OPT_SUPPORTED
Expand Down
16 changes: 8 additions & 8 deletions usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ the reconstructed image: the higher the quality setting, the larger the JPEG
file, and the closer the output image will be to the original input. Normally
you want to use the lowest quality setting (smallest file) that decompresses
into something visually indistinguishable from the original image. For this
purpose the quality setting should be between 50 and 95; the default of 75 is
often about right. If you see defects at -quality 75, then go up 5 or 10
counts at a time until you are happy with the output image. (The optimal
setting will vary from one image to another.)
purpose the quality setting should generally be between 50 and 95 (the default
is 75) for photographic images. If you see defects at -quality 75, then go up
5 or 10 counts at a time until you are happy with the output image. (The
optimal setting will vary from one image to another.)

-quality 100 will generate a quantization table of all 1's, minimizing loss
in the quantization step (but there is still information loss in subsampling,
as well as roundoff error). This setting is mainly of interest for
experimental purposes. Quality values above about 95 are NOT recommended for
normal use; the compressed file size goes up dramatically for hardly any gain
in output image quality.
as well as roundoff error.) For most images, specifying a quality value above
about 95 will increase the size of the compressed file dramatically, and while
the quality gain from these higher quality values is measurable (using metrics
such as PSNR or SSIM), it is rarely perceivable by human vision.

In the other direction, quality values below 50 will produce very small files
of low image quality. Settings around 5 to 10 might be useful in preparing an
Expand Down

0 comments on commit 6fa5ebd

Please sign in to comment.