Friday, November 10, 2023

Make It Obvious | Graphically Annotating Images with Metadata for Easy Analysis

To analyze my DSLR usage I wanted an easy way to look at day's worth of photos and see which were taken with my cell phone and which with my Canon Rebel. The first challenge was normalizing the image capturing device and timestamp. That was tricky, but doable. Annotating the images with this data turned out to be straightforward. ImageMagick easily had me covered.

Ultimately, I settled on the following convert command. It adds a colored border based on the camera that took the photo and prints the timestamp and device in the corners. I scale the image down to 800 pixels wide to make large numbers of images easy to work with.

      convert $file -scale 800x \
              -bordercolor "$color" -border 20 \
              -pointsize 10 -fill white \
              -draw "text 800,15 '$device'" \
              -draw "text 15,15 '$timestamp'" $output/$outfile

I incorporated this command into photoassist as -a analyze. Running analyze against 6 gigs worth of photos from our 4th day in Tucson yielded a paltry 160 megs(!) worth images. The images have all had their names normalized to the format <date>_<time>_<device>.jpg. Using this convention I can see, for example, just the photos I took from 10am to 11am:

$ ls 20230709_10*
20230709_101428_s22.jpg  20230709_102534_s22.jpg  20230709_104116_t6s.jpg  20230709_104225_t6s.jpg  20230709_104510_s22.jpg  20230709_104850_s22.jpg  20230709_105050_s22.jpg  20230709_105245_s22.jpg
20230709_101801_t6s.jpg  20230709_102541_s22.jpg  20230709_104127_t6s.jpg  20230709_104229_t6s.jpg  20230709_104511_s22.jpg  20230709_104851_s22.jpg  20230709_105053_s22.jpg  20230709_105247_s22.jpg
20230709_101802_t6s.jpg  20230709_102837_s22.jpg  20230709_104139_s22.jpg  20230709_104234_t6s.jpg  20230709_104539_t6s.jpg  20230709_104854_s22.jpg  20230709_105055_s22.jpg  20230709_105312_s22.jpg
20230709_101804_t6s.jpg  20230709_102839_s22.jpg  20230709_104141_s22.jpg  20230709_104237_t6s.jpg  20230709_104549_t6s.jpg  20230709_104855_s22.jpg  20230709_105059_s22.jpg  20230709_105422_s22.jpg
20230709_101805_t6s.jpg  20230709_102843_s22.jpg  20230709_104150_s22.jpg  20230709_104259_s22.jpg  20230709_104559_t6s.jpg  20230709_104924_t6s.jpg  20230709_105101_s22.jpg  20230709_105532_s22.jpg
20230709_101810_t6s.jpg  20230709_102948_s22.jpg  20230709_104150_t6s.jpg  20230709_104327_t6s.jpg  20230709_104601_t6s.jpg  20230709_104926_t6s.jpg  20230709_105106_s22.jpg  20230709_105534_s22.jpg
20230709_101812_t6s.jpg  20230709_103541_s22.jpg  20230709_104153_s22.jpg  20230709_104328_t6s.jpg  20230709_104636_t6s.jpg  20230709_104932_s22.jpg  20230709_105131_t6s.jpg  20230709_105537_s22.jpg
20230709_101813_t6s.jpg  20230709_103543_s22.jpg  20230709_104153_t6s.jpg  20230709_104336_t6s.jpg  20230709_104712_s22.jpg  20230709_104933_s22.jpg  20230709_105133_t6s.jpg  20230709_105607_s22.jpg
20230709_101815_t6s.jpg  20230709_103849_s22.jpg  20230709_104154_s22.jpg  20230709_104344_t6s.jpg  20230709_104713_s22.jpg  20230709_104950_t6s.jpg  20230709_105139_s22.jpg  20230709_105614_s22.jpg
20230709_101816_t6s.jpg  20230709_104029_t6s.jpg  20230709_104154_t6s.jpg  20230709_104347_t6s.jpg  20230709_104715_s22.jpg  20230709_104954_t6s.jpg  20230709_105143_t6s.jpg  20230709_105617_s22.jpg
20230709_101819_t6s.jpg  20230709_104040_t6s.jpg  20230709_104155_t6s.jpg  20230709_104348_t6s.jpg  20230709_104716_t6s.jpg  20230709_104957_t6s.jpg  20230709_105144_t6s.jpg  20230709_105630_s22.jpg
20230709_101820_t6s.jpg  20230709_104044_t6s.jpg  20230709_104156_t6s.jpg  20230709_104438_t6s.jpg  20230709_104737_s22.jpg  20230709_105002_s22.jpg  20230709_105158_s22.jpg  20230709_105631_s22.jpg
20230709_102431_s22.jpg  20230709_104047_t6s.jpg  20230709_104157_s22.jpg  20230709_104455_s22.jpg  20230709_104742_t6s.jpg  20230709_105004_s22.jpg  20230709_105201_s22.jpg  20230709_105659_s22.jpg
20230709_102524_s22.jpg  20230709_104050_t6s.jpg  20230709_104159_t6s.jpg  20230709_104456_t6s.jpg  20230709_104743_t6s.jpg  20230709_105010_s22.jpg  20230709_105206_s22.jpg
20230709_102527_s22.jpg  20230709_104058_t6s.jpg  20230709_104203_s22.jpg  20230709_104457_s22.jpg  20230709_104746_t6s.jpg  20230709_105012_s22.jpg  20230709_105215_s22.jpg
20230709_102532_s22.jpg  20230709_104101_t6s.jpg  20230709_104222_t6s.jpg  20230709_104503_t6s.jpg  20230709_104822_t6s.jpg  20230709_105034_t6s.jpg  20230709_105239_s22.jpg

Using feh I can preview these images as a contact sheet:

$ feh -m -E 120 -y 160 20230709_10* -H 1000

All the photos with a red border were captured with my Canon DSLR, the photos with a blue border were from my Galaxy S22. I can also use feh to inspect the images manually:

$ feh 20230709_10*

Using these annotated images I get a much better picture (hah!) of how and to what effect I use my DSLR. Up next, I want to spend some time with these images and see if I can reach any useful conclusions.

No comments:

Post a Comment