jarun / imgp

:camera_flash: Fast batch image resizer and rotator
GNU General Public License v3.0
1.03k stars 50 forks source link

Be lossless when possible #20

Closed drrlvn closed 7 years ago

drrlvn commented 7 years ago

For JPEG for example, the command jpegtran is able to losslessly perform several operations like flip, rotate by a multiple of 90 degrees and others. From its man page:

jpegtran works by rearranging the compressed data (DCT coefficients), without ever fully decoding the image. Therefore, its transformations are lossless: there is no image degradation at all, which would not be true if you used djpeg followed by cjpeg to accomplish the same conversion.

jarun commented 7 years ago

We do our best with what Pillow supports: