I wanted to see my trend of digital phototaking over the years. My hypothesis being that there is an upswing each time I acquire a new device (camera, phone ...etc.) and a boost with the advent of camera phones.

The simplest idea, I had was to gather the dates of each photo in a given set of photos (folder including subfolders), and then count the photos for each date.

Then plot this information in excel or some other tool. Preferably in a timeline sort of way with zooming in or out of data, i.e. change the axes from day to week, to month, to quarter to years.

Is there any utility that does this already very simply?

  • \$\begingroup\$ If you use Lightroom this plugin might be helpful. \$\endgroup\$ Feb 27, 2014 at 15:41
  • \$\begingroup\$ see my answer here as this solves the same problem in a different way, not with a satisfying plot though. \$\endgroup\$
    – Vijay
    Apr 3, 2014 at 10:11

3 Answers 3


I had a script which did something else, but it's easily modifiable to do what you want (at least the initial part):

from PIL import Image
from PIL.ExifTags import TAGS
import sys
import os
import getopt

def get_exif_data(fname):
    """Get embedded EXIF data from image file."""
    ret = {}
        img = Image.open(fname)
        if hasattr( img, '_getexif' ):
            exifinfo = img._getexif()
            if exifinfo != None:
                for tag, value in exifinfo.items():
                    decoded = TAGS.get(tag, tag)
                    ret[decoded] = value
    except IOError:
        print 'IOERROR ' + fname
    return ret

def main(argv):
    path = ''
    outputfile = ''
        opts, args = getopt.getopt(argv,"hp:o:",["path=","ofile="])
    except getopt.GetoptError:
        print argv[0] + ' -p <path> -o <outputfile>'
        print 'where:'
        print '\t<path> is the root directory path for all the images'
        print '\t<outputfile> is the CSV file to write to'
    for opt, arg in opts:
        if opt == '-h':
            print argv[0] + ' -p <path> -o <outputfile>'
        elif opt in ("-p", "--path"):
            path = arg
        elif opt in ("-o", "--ofile"):
            outputfile = arg

    if path == "" or outputfile == '':
        print 'error: arguments missing'
    if not os.path.isdir(path):
        print 'error: path entered is not a directory'
    photoCount = {}
    for root, dir, files in os.walk(path):
        for item in files:
            if item.lower().endswith(".jpg"):
                exif = get_exif_data(root + "\\" + item)
                if 'DateTime' in exif.keys():
                    date = exif['DateTime'][:10].replace(":","-")
                    if date in photoCount.keys():
                        photoCount[date] = photoCount[date] + 1
                        photoCount[date] = 1

    outcsv = open( outputfile, 'w' )
    for key in photoCount.keys():
        outcsv.write(key + ',' + str(photoCount[key]) + '\n')

if __name__ == "__main__":

When I run this on my sample directory (with a few folders of images), I get:


Ofcourse this needs to be sorted and all, but, this can be opened in excel and manipulated from there on.

  • \$\begingroup\$ This is awesome, this is almost exactly the script I was writing. I was just now working on the exif part! I even have the save 2 csv working, thought currently with file modified dates rather than exif dates. Let me test it out! \$\endgroup\$
    – Vijay
    Feb 27, 2014 at 8:54
  • \$\begingroup\$ For the plotting I was thinking of using something from here nbviewer.ipython.org \$\endgroup\$
    – Vijay
    Feb 27, 2014 at 8:56
  • \$\begingroup\$ Ok, it was a pain to install PIL on windows (had to rename the egg folder), and had to make a few changes to your code for it to work (case insensitive check, replace : with -) and I can confirm it works. \$\endgroup\$
    – Vijay
    Feb 27, 2014 at 9:46

You can use a DAM software that will collect all metadata from your images and display statistical info about who often did you take photos, by what cameras, lenses plus many other useful information:

enter image description here

  • \$\begingroup\$ The years might be expanded to months, that you can expand to days. You can even see the date trend per selected camera. \$\endgroup\$ Feb 26, 2014 at 12:00
  • \$\begingroup\$ Yes, I'd seen this on picajet's website but not on daminion's site. I even downloaded picajet but wasn't sure if I could do it in the free version so haven't tried yet. However, can I export this info and plot it? The key is I need a graph. \$\endgroup\$
    – Vijay
    Feb 27, 2014 at 2:47
  • 1
    \$\begingroup\$ You can download the Daminion from daminion.net. It's free for managing small image collections (less than 15,000 files per one local catalog). At least you can check whether it works with you or no. You can export files and their properties (including dates) to CSV format and then try to build graphic in Excel (Item > Export > Export to CSV...) You can also try to work with Daminion catalogs directly: standalone version uses SQLite engine, multi-user version uses PostgreSQL. Both are open-source and free. \$\endgroup\$ Feb 27, 2014 at 7:18

It really depends what OS you are on and what you have.

If you are on Lnux, you could possibly use a recursive shell script to read the dates from image files and thus collect the data (without any further software).

If you have Adobe Lightroom you can sort images by date taken (if I am not mistaken). -> Go to Catalogue, all photos -> Metadata -> date Obviously as Murat suggested, many other photo editors can do the same.

You would need software that manages your library if you want an easy method of sorting photos and getting counts per year or even month or day etc.

  • \$\begingroup\$ I would prefer a cross-platform solution first, then windows only next. That's why a script is fine, as long as it's supported on all. I started writing a python script and have it working for regular files (saves a csv) but working on extracting the exif data using the regular libraries rather than a separate one. I've considered exiftool just cursorily, but maybe that could work the most effectively. \$\endgroup\$
    – Vijay
    Feb 27, 2014 at 2:49
  • \$\begingroup\$ If you want a cross platform solution then you only have two choices; 1) a script (or small program compiled from source) 2) a cross platform library manager (there are DigiKam and RawTherapee that are open source and cross platform but I am not sure how good their sorting facilities are.) \$\endgroup\$
    – DetlevCM
    Feb 27, 2014 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.