Recently we cropped a JPEG photo a lot in Photoshop Elements, and noticed we had lost a lot of resolution when we had the photo printed. Would it have been better to shoot in Raw, and not lose so much resolution?
Note that you can crop JPEG images without having to reencode them if you use tools that work with the JPEG format, such as
jpegtran - these tools perform lossless operations on JPEG files, including cropping, concatenation, and certain transformations (e.g. 90-degree rotation) by working with the underlying DCT data (as opposed to setting a rotation EXIF value, for example).
When shooting JPEG you usually have to option to select the size and quality of your image. For instance with Nikon cameras you can select Large and Fine. This option will give you the maximum resolution. This is also the resolution of the RAW file so you will not gain any resolution if you shooting at the maximum JPEG quality. Shooting RAW will give you more leeway with exposure and color editing but will not necessarily give you more pixels to work with.
How much cropping did you do, and what is your definition of "a lot of resolution?" The answer is always "doing everything in raw is better," always, simply by definition. It is never better to use a compressed image if you can use an uncompressed image, simple as that. However, whether the difference is perceptible depends on what you're doing. At my skill level I do a lot in JPEG simply because the benefits of going RAW are outweighed by my lack of experience working with the format.
I would definitely look at JPEG compression settings first. The difference between cropping in RAW and cropping in JPEG should be minimal compared to the losses that come from a low quality JPEG compression.
The one specific issue I could see is if you cropped the image to a region which was not aligned to 8 pixels. JPEG cuts the image into 8x8 blocks and then encodes each one. If you happened to crop on one of those lines, there should be virtually no degradation in quality due to the crop. However, if you did not hit that boundary, then when you re-save the image as JPEG, the new JPEG's 8x8 blocks will not be aligned with the old ones. They'll have edges in them, and re-compressing those could create artifacts. Lower quality JPEG compressions will be less forgiving because there will be more noise on these edges.
This photo from wikipedia shows the nature of the JPEG compression artifacts. It is set up to be heavily compressed on the left and lightly compressed on the right. You can see the 8x8 blocks. Clearly the more blocky it is, the more you are going to be punished for miss-cropping it. Sharp edges are very hard on JPEG if they're not perfectly aligned on 8x8 boundaries, due to the way the compression works. (This is why you always use .png for line-art graphics rather than .jpg)
When you crop an image you inevitably lose resolution, as you delete parts of the recorded image to better frame the remaining. This will become more noticeable when you enlarge the resulting image on a large screen or print, depending on the final resolution.
But beside that, you may lose some more detail due to a number of factors:
- saving the jpeg with lower quality settings than before;
- downscaling the resulting image further;
- using a software with poor jpeg compression;
- cropping (or any editing involving saving and re-loading the picture) multiple times may result in repeated resampling of the image;
- cropping to a size which is not a multiple of the block size of the jpeg may also result in resampling and loss of detail.
Pushing the conversion from RAW to JPEG as late as possible in the editing process will surely preserve the resolution better, but if you take care of these aspects you will get very similar results with the JPEG as well.
JPEG is a lossy compression format. RAW retains the full pixel information of the original image. If you crop a JPEG image, you are cropping am image that is already missing pixel information due to the JPEG compression algorithms. Always crop a RAW image for best results. If you are going to resize an image, do the math first. Use even increments like resizing a 1024x768 pixel image to 512x384.