OS X: How to perform a lossless crop of a JPEG image?

All we need is an easy explanation of the problem, so here it is.

I’m looking for a simple way to losslessly crop JPEGs on Mac OS X.

Particularly, is there some way to get Preview to perform a lossless crop?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

I use Xee. It is so much better than preview for images (IMHO); especially since you can traverse images within the same folder by clicking the arrow buttons. All of the button short cuts are reprogrammable.

It supports lossless cropping and rotation. Just see the webpage.

If you like it, buy milksnake to help the developer out – I did.

Method 2

This command worked for me:

jpegtran -crop WxH+X+Y infile.jpg outfile.jpg

While perhaps not lossless I found FFmpeg to also do quite well:

ffmpeg -i infile.jpg -filter crop=W:H:X:Y -qmax 1 outfile.jpg

Method 3

Based on this answer, I can suggest using the command-line tool jpegtran, the GUI-based Jpegcrop Windows program, or one of the many programs based on IJG jpegtran code (although not all of them support cropping).

Method 4

If you don’t mind the result in a different file format. You can use Preview. Export the JPEG to TIFF, then crop the TIFF file as normal. If you would prefer the result to be a JPEG file you will have to use third party software.

Method 5

I you are worried about “lossless” – don’t use jpg. Every time you open one, and then save it – you are losing some data – even at the highest setting. If anyone disputes this, just open an untouched image in PS (for instance), and then save it and open it several times at the highest setting. You will notice artifacts. (Magnify the file several times and compare with the original.)

So just crop it and save it in preview. There will be almost imperceivable loss.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply