Potental new ExifTool plot feature

Started by Phil Harvey, February 14, 2025, 12:59:55 PM

Previous topic - Next topic

Phil Harvey

I'm toying with a new output format for ExifTool.  I would use it myself a lot but I'm not sure anyone else would get excited about this.

I would use this to save time when plotting tag values.  Instead of outputting in CSV format then importing into Excel for plotting, ExifTool would output the plot directly in SVG format.  I've been doing this sort of thing a lot recently when decoding unknown timed metadata from drones, and this feature will save me the Excel step.  Here is an example command:

exiftool test.mp4 -ee -u -api filter='s/.* float //;s/\)$//' "-Dvtm_ac204_3-2-10-*" -plot > out.svg

(the API Filter is necessary for unknown protobuf information like this in order to select the appropriate numerical format)

And here is the result:



- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Martin B.

I would find this feature very useful, but I would use it infrequently as I don't look for unknown tags as often as you Phil...   ;)

Same as you, I have used Excel to post-process ExifTool output, including graphs but also correlations, to find unknown tags.

Phil Harvey

ExifTool 13.20 has just been released with this new plot feature!

Plus, I've enhanced the feature to make it more configurable, and to add scatter and histogram plot types.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

greybeard

As an initial test I tried to plot iso and aperture following the format in the first example:

exiftool -iso -aperturevalue -plot -ext jpg . -fileorder createdate > plot1.svg

I got the following output:

Experimental unshift on scalar is now forbidden at /usr/local/bin/lib/Image/ExifTool/Plot.pm line 136, near "$tag;"
Compilation failed in require at /usr/local/bin/exiftool line 1181.

Phil Harvey

#4
Thanks for reporting this!

A rather inauspicious start for an otherwise (hopefully) very promising new feature.

It is unfortunate that my version of Perl accepted this syntax.  It is very rare for me to encounter a compiler issue in Perl.

I have just released a patched version (13.21) that should resolve this issue.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

greybeard


greybeard

Focal Length Plot

This is a simple example of the sort of thing I had in mind for plotting - where its possible to analyse a set of images by tag - this shows the number of images by lens focal length.

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

greybeard

Quote from: Phil Harvey on February 21, 2025, 08:52:34 PMYou did see example 2 on the Plot page?

- Phil

Yes but it would be more useful to be able to see the exact focal length on the X axis.

The sort of plotting I tend to do is to analyse a set of images to answer questions like: when and how often were the photos taken, which lens and camera model was used?

I was able to contrive an analysis by create date but couldn't make the values on the X axis useful.

This isn't to take away from the value of the new functionality but its probably not for the sort of plotting I tend to do which would be of unique values (of various types) rather than numeric ranges.

Phil Harvey

Histograms are tricky because the values may be continuous as in my plot where a built-in zoom lens was used, or discrete and perhaps even non-numeric as in your case.  Thanks for the feedback, I'm open to adding more features if there is enough interest.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

greybeard

I'm getting an error message I don't understand - it doesn't seem to affect the command which produces the expected output (I get the same error message using redirection instead of the -w argument):

exiftool -focalLength# -api plot='type=hist,style=fill,cols=blue' -plot -w p4.svg .

Error: File is empty - ./p4.svg
    1 directories scanned
  67 image files read
    1 output files created

Phil Harvey

Interesting.  I'm away from home this weekend so I can't check the code right now to see how this could happen, but the command looks ok to me.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).