I was quite confused when I read your post because Tesseract is an OCR engine. Your link helped sort it out.
I think I have come across various fedi web clients that do conversions. I think peertube shrinks videos, IIRC. The auto conversions are useful but they must be conservative in the extent of their changes. The posterizing that I do w/Imagemagick makes a dramatic change so it could not be done automatically by a client or server, as users need to review the output and decide. So I believe the best compression will always require manual effort in order to judge whether the quality loss is still acceptable for the application.
Regarding Tesseract (the lemmy client) -- does that work offline? I’m always looking for a Lemmy client that can briefly connect to sync content and then support reading and writing messages when offline.