Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer
Nice... and from the makers of Unarchiver – Full Decent Feb 23 '15 at 0:32

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
share|improve this answer
I've never seen ffmpeg suggested as an image editing tool, haha. Interesting. But yes, that's not lossless. jpegtran is. – Fred May 11 at 22:10

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).

share|improve this answer

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.

share|improve this answer
Doesn't sound very lossless, once you convert back to JPEG format. – Matt M. Aug 6 '11 at 23:54
@Matt There is currently nothing in the question that indicates that the result has to be JPEG. Only that the cropping action should be lossless and that ideally the cropping action should be performed in Preview. As I understand it - converting the image first to a lossless format such as TIFF is the only way not to loose any more data. See the answer from MrHelpYou for further explanation on why this is the case. – zenopolis Aug 7 '11 at 9:44
@Matt My bad - I now realise that lossless JPEG editing is possible (just not in Preview). I'll change my answer so that it does give a more accurate answer. – zenopolis Aug 10 '11 at 7:50

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.

share|improve this answer
Well, this is completely wrong. Lots of software supports lossless cropping, rotating, and sometimes even editing of JPEGs, just not Preview. – Matt M. Aug 7 '11 at 23:03
This will happen with any image compression. What your suggesting is the equivalent of repeatedly copying a copy of a copy on a imaging machine. – skub Aug 8 '11 at 0:24
No, fancy algorithms have been developed to crop and rotate jpegs, look here. Obviously it is not losselss wrt the original source, but wrt the previous generation jpeg. Don't worry, I would never have guessed anybody would have done that until I googled it just now. – Eroen Mar 13 '12 at 2:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .