JMM’s notes on


Command Line

Get EXIF data

Running exiftool $YOURFILE will output something like:

ExifTool Version Number         : 12.50
File Name                       : test.png
Directory                       : .
File Size                       : 5.0 kB
File Modification Date/Time     : 2023:12:05 15:03:53-08:00
File Access Date/Time           : 2023:12:05 15:03:53-08:00
File Inode Change Date/Time     : 2023:12:05 15:38:48-08:00
File Permissions                : -rw-r--r--
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 298
Image Height                    : 92
Bit Depth                       : 8
Color Type                      : RGB with Alpha
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Significant Bits                : 8 8 8 8
Software                        : gnome-screenshot
Creation Time                   : Tue 05 Dec 2023 03:03:41 PM PST
Image Size                      : 298x92
Megapixels                      : 0.027

Remove EXIF data

exiftool -all= -tagsfromfile src.jpg -exif:all dst.jpg

(TODO: Haven’t yet checked if this correctly handles orientation. Normally I use “mogrify -auto-orient -strip $FILE”. )

Also, you shouldn’t do this if the metadata contains licensing info.

Add metadata

Here’s how you might add some info to a screenshot:

exiftool -artist="Josh Mōller-Mara" $FILE

If you want it in XMP:

exiftool -XMP-dc:Creator="Josh Mōller-Mara" $FILE


Also see XMP Tags.

Here’s how you’d output XMP to standard output:

exiftool $FILE -o -.xmp

or exiftool -tagsfromfile a.jpg out.xmp if you want to output to a file.

That’ll give you something like:

<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 12.50'>
<rdf:RDF xmlns:rdf=''>

 <rdf:Description rdf:about=''
    <rdf:li>Josh Mōller-Mara</rdf:li>

 <rdf:Description rdf:about=''
  <tiff:Artist>Josh Mōller-Mara</tiff:Artist>
<?xpacket end='w'?>

To copy XMP to another file:

exiftool -all= -tagsfromfile out.xmp -xmptoolkit= a.png

This also prevents the XMP toolkit tag from being created.

XMP for a screenshot

Mark with a title, description, and license under Creative Commons.

exiftool -XMP-dc:Creator="Josh Mōller-Mara" \
	 -XMP-dc:Date="$(date +%Y-%m-%d)" \
	 -XMP-dc:Title='Some title' \
	 -XMP-dc:Description='Some description' \
	 -XMP-dc:Rights="© Copyright $(date +%Y) Josh Moller-Mara" \
	 -XMP-cc:AttributionName="Josh Mōller-Mara" \
	 -XMP-cc:AttributionURL="" \
	 -XMP-cc:License="" \
	 -XMP-xmpRights:Marked=true \
	 -XMP-xmpRights:UsageTerms="This image is licensed under Creative Commons Attribution-ShareAlike 4.0 International" \
	 -xmptoolkit= \

If you set the file to something like “out.xmp”, it’ll just create an XMP file from these tags. This can be handy if you’re writing XMP metadata with another program, for example with WebP metadata (since ExifTool can’t write WebP files).