Here is a short script (1.6kb) to add a timestamp on all PNG pictures in a directory. It requires Python and the Python Image Library (PIL). In order to use it, modify some parameters in the beginning to suit your needs (images directory, font file and size, etc.) and launch ./timestampFiles.py
. Here is a before/after example (size of pictures is reduced to fit in this blog):
Note 1: the font is not included in the script. Here, I used FreeSans which is a true free font (GNU GPL with font exception). It is available here (local copy, just the FreeSans font, 753kb).
Note 2: I chose to convert PNG images to JPG ones for 2 reasons. First, my capture script gives me PNG images (see previous posts). Second, I want to be able to copy all JPG pictures in a MJPEG movie. It shouldn’t be difficult to change the different file formats to suit your needs (ask me if you can’t do that).
Note 3: I guess this would also have been possible using a bash script and imagemagick, Perl or any other programming language 😉
Looks useful, but http://www.jepoirrier.net/blogimages/timestampFiles.py is not available 😦
I get an access forbidden error.
Thanks for the notice! I put the script here: https://github.com/jepoirrier/miscScripts/blob/master/timestampFiles.py
Hope this helps!
Jean-Etienne
Thank you!