Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jpegtran optimized file size regression between mozjpeg and 3.1 and 4.1.1 #433

@pts

Description

@pts

mozjpegtran in mozjpeg 4.1.1 (same output as 4.0.3) creates larger output files than the output files in mozjpeg 3.1 (same output as 4.0.0, 3.3.1 and 3.0) for some inputs (e.g. lab.jpg). For some other input files (e.g. lenna.jpg), it's the other way round.

Examples:

$ jpegtran-mozjpeg-3.1 -copy none <lab.jpg >lab31.jpg
$ jpegtran-mozjpeg-4.1.1 -copy none <lab.jpg >lab411.jpg  # Larger than lab31.jpg.
$ jpegtran-mozjpeg-3.1 -copy none <lenna.jpg >lenna31.jpg
$ jpegtran-mozjpeg-4.1.1 -copy none <lenna.jpg >lenna411.jpg  # Smaller than lenna31.jpg.

Input files:

Output files:

  • lab31.jpg: 400769 bytes, identical file created by version 3.0, 3.1, 3.3.1 and 4.0.0
  • lab411.jpg: 402438 bytes, identical file created by version 4.0.3 and 4.1.1
  • lenna31.jpg: 36172 bytes, identical file created by version 3.0, 3.1, 3.3.1 and 4.0.0
  • lenna411.jpg: 36111 bytes, identical file created by version 4.0.3 and 4.1.1

Output of the CLI version of jpegsnoop on various files:

  • lab.jpegsnoop.out
  • lab31.jpegsnoop.out
  • lab411.jpegsnoop.out
  • Please note that I don't trust jpegsnoop much, because all 3 outputs contain an error ERROR: Early EOF - file may be missing EOI, but all other image processing software I tried can read, display and process these JPEG files without an error.

In general, most JPEGs taken by recent mobile phones are larger when optimized with version 4.1.1 than with 3.1.

Am I using jpegtran correctly? Is it possible to specify command-line flags for version 4.1.1 so that the output JPEG won't be larger than of 3.1?

I have tried at all command-line flags of mozjpegtran in version 4.1.1, especially -fastcrush, -restart ..., -maxmemory ..., -maxscans ... and -verbose -verbose -verbose -verbose -verbose, but they didn't make the JPEG output file lab411.jpg as small as lab31.jpg.

If not, then could you please fix it in the next version? I'd like to use jpegtran of a recent mozjpeg for lossless JPEG optimization, but I'd like to keep the output file as small as possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions