jpegtran allows to rotate/crop/join a JPG file without any quality loss nor file size increase.

Is there a Java or Kotlin library to achieve these lossless operations in Android?


  • libjpeg-turbo's Java library is almost perfect but unfortunately it does not implement the join (called -drop) operation, even though the C library of the same project does. Probably the easiest to port if necessary.
  • AndroidMediaUtil and LLCrop also do not support join.
  • maven-jpegtran-plugin calls the jpegtran OS executable, so it is not 100% Java.
  • Android's source code includes jpegtran.c but I have not found any way for an app to call it, I guess it is only used internally, maybe only present because it is a part of libjpeg.

Must be open source.
Libraries that only do one operation, for instance only crop, are very welcome too!

1 Answer 1


LLCrop is open source. I hope this helps!

  • It does not support the join operation, right? LLCrop uses the Spectrum library, which uses mozjpeg, which is a patch over libjpeg-turbo, whose Java version does not have join.
    – Nicolas Raoul
    Apr 6, 2022 at 4:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.