EXIF questions..

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
dognose
Posts: 267
Joined: 2005-03-08T22:16:37-07:00

EXIF questions..

Post by dognose » 2013-12-20T13:33:23-07:00

Excuse my ignorance, just trying to get handle of EXIF, I thought I knew it.

1. Which file types support EXIF? Is it just JPG?

2. Does editing or removing EXIF data affect the image quality (other than file size)? Ie. lossyness in JPG.

3. How do you set EXIF data?

4. Same questions with the "-comment" command. Is that EXIF, or another meta data?

snibgo
Posts: 12315
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: EXIF questions..

Post by snibgo » 2013-12-20T14:30:55-07:00

1. See http://en.wikipedia.org/wiki/Exchangeab ... ile_format.

2. No.

3. When I do, which is rare, I use exiftool, which reads/writes more metadata than merely Exif.

4. Sometimes the comment goes into Exif, sometimes elsewhere.
snibgo's IM pages: im.snibgo.com

dognose
Posts: 267
Joined: 2005-03-08T22:16:37-07:00

Re: EXIF questions..

Post by dognose » 2013-12-21T09:12:54-07:00

so, I found one of the threads that talked about lossyness on saving JPG images.

viewtopic.php?f=1&t=23823&p=101226&hili ... pg#p101226

fmw42 wrote:
"If JPG, then yes, because it is a lossy compression. Thus each time it is opened and saved it will lose some quality."

Does anyone else have an opinion on this? This is rather surprising to me.

snibgo
Posts: 12315
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: EXIF questions..

Post by snibgo » 2013-12-21T09:30:38-07:00

The statement is true. Jpeg is a lossy compression method, which means that it loses information, in other words it changes pixel values. This is especially noticeable on graphic images with flat colour, and less noticeable with photographs.

See http://www.imagemagick.org/Usage/formats/#jpg
snibgo's IM pages: im.snibgo.com

Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: EXIF questions..

Post by Bonzo » 2013-12-21T10:17:30-07:00

I add my EXIF data in Microsoft pro photo tools and use RAW now and there is not a problem. When I first used the tool I was using jpg files and I contacted Microsoft about the recompression problem and I was told the method they used did not add any compression.
I know Imagemagick opens and saves a jpg even if nothing is done to the photo, I wonder if you can add data to a file rather than opening it?

snibgo
Posts: 12315
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: EXIF questions..

Post by snibgo » 2013-12-21T10:51:16-07:00

As a general rule, IM will always read a jpeg and re-write it, even if the image hasn't changed. For example:

Code: Select all

convert -size 100x100 gradient:red-khaki r1.jpg

convert  r1.jpg r2.jpg

compare -metric RMSE r1.jpg r2.jpg NULL:

41.9679 (0.00064039)
If the requirement is merely to change metadata, IM is a poor choice of tool.
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 25668
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EXIF questions..

Post by fmw42 » 2013-12-21T11:55:32-07:00

If the requirement is merely to change metadata, IM is a poor choice of tool.
That is why snibgo orignally reference you to EXIFTOOL. It will allow you to read and edit meta data without affecting the image data. It works with other formats than jpg. I have used it to read meta data for tiff and png and psd.

IM will not allow you to modify meta data except for perhaps the comment and some specific information as I recall for jpg and png. So if you want to edit meta data, use EXIFTOOL.

snibgo
Posts: 12315
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: EXIF questions..

Post by snibgo » 2013-12-21T12:04:52-07:00

I've realised my short answer may have been misleading. My apologies.
dognose wrote:2. Does editing or removing EXIF data affect the image quality (other than file size)? Ie. lossyness in JPG.
snibgo wrote:No.
What I meant was: editing or removing EXIF data doesn't, in itself, affect the image quality. (Although removing colour profiles will change the image colours.)

However, IM isn't a utility for merely editing EXIF data. It is an image processor, so it primarily reads and writes images. If IM is used to edit EXIF data, it will also reduce the quality of a JPEG image.
snibgo's IM pages: im.snibgo.com

Post Reply