wwwald
wwwald

Reputation: 460

Re-saving JPEG files introduces unwanted differences

I have a JPEG that will be processed by image analysis algorithms. It has been labelled in the corner of the picture, but I need to remove the label before processing.

BUT: opening the JPEG in Gimp, editing out the label and re-saving, introduces small differences in the image content outside of the label, too. In the export settings, I have disabled everything aside from "Use quality settings from original image", but still there are minute pixel-level differences when comparing with the original.

Is there a way to preserve all pixel information exactly? Or are these changes inevitable given the JPEG format?

Upvotes: 0

Views: 73

Answers (3)

Lamar Latrell
Lamar Latrell

Reputation: 1669

The changes are inevitable given the JPEG format.

Using the same settings you will incur 'generation loss' as you have experienced.

Using higher (less aggressive compression) settings will only lead to a catch-22 where you're giving up hard disk space to save no additional information other than perhaps a higher resolution sampling of the artefacts from the original compression.

Solution is to convert your images to TIFF, PNG or similary lossless format in the save step after removing the label and move on from there.

Upvotes: 5

user3344003
user3344003

Reputation: 21617

If you want to minimize the differences, your recompressed image should use the same compression settings as the original: same sampling and same quantization tables.

Upvotes: -1

MANIAK_dobrii
MANIAK_dobrii

Reputation: 6032

If you required perfect per pixel color information you made a huge mistake selecting JPEG. You may even get different color information for the same JPEG file using different decompression implementations (or even hardware and it's state).

I'd suggest to try converting your JPEGs to some non-loosy format like PNG and then proceed with your editions. Even better would be if you'd configured your image analysis algorithms to output in some lossless format.

Upvotes: 0

Related Questions