Compare .jpg original to saved .tif

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
tackd
Posts: 42
Joined: 2013-12-30T07:39:08-07:00
Authentication code: 6789

Compare .jpg original to saved .tif

Post by tackd »

If I open an original .jpg file (original.jpg), and then save as .tif (saved.tif) without any edits or changes...
Souldn't the 2 images be the same since .tif does not recompress ?

When I do the above and use;
$ compare original.jpg saved.tif ComparedResult.png

Shouldn't there be no 'red' marks designating changes ?

Thank you.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compare .jpg original to saved .tif

Post by snibgo »

tackd wrote:.... since .tif does not recompress
It does recompress, and it may be lossy compression that will change the pixel values.

For further help, you need to supply details: link to the original JPG and saved TIF, tell us how you saved as TIF (with IM or some other software), software versions, on what platform.
snibgo's IM pages: im.snibgo.com
tackd
Posts: 42
Joined: 2013-12-30T07:39:08-07:00
Authentication code: 6789

Re: Compare .jpg original to saved .tif

Post by tackd »

-----------------------------------Method 2 Failed-------------------------------------------------------

1. Original: https://unsplash.com/photos/pHANr-CpbYM
2. Filename: wil-stewart-18242-unsplash.jpg
3. Export to uncompressed .tif (Below: XnViewMP v.90)

Image

4. Result: https://biz.kwamsook.com/ImageMagick/wi ... viewMP.png
5. Comment: Differences shown in red, should be identical ?

-----------------------------------Method 2 Success------------------------------------------------------

I tried the above using imagemagick Version: 8:6.8.9.9-7ubuntu5.12
1. convert wil-stewart-18242-unsplash.jpg wil-stewart-18242-unsplash.tif
2. compare wil-stewart-18242-unsplash.jpg wil-stewart-18242-unsplash.tif wil_Result_im6.png
3. Result here: https://biz.kwamsook.com/ImageMagick/wil_Result_im6.png

Wow... thank you ImageMagick. If I'm correct, XnViewMP is 'not' saving the .tif file unaltered, and ImageMagick 'is'.
When I save a .jpg to .tif (uncompressed) in imagemagick, it preserves the image quality of the expanded .jpg.

Is my conclusion correct ?

Thank you.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compare .jpg original to saved .tif

Post by snibgo »

I don't have XnViewMP so can't verify that result.

Using IM to convert a JPG to a TIFF with no compression (or with a lossless compression such as LZW or ZIP) won't change pixels.
snibgo's IM pages: im.snibgo.com
Post Reply