I have a bunch of jpeg images.
Say 001abcd.jpg
,
002abcd.jpg
,
and so on.
I want to capture the filename and add it as a text in the image itself in one corner.
So the result would be, for example, the file 003abcd.jpg
will have "003abcd" imprinted in one corner of that image. (The extension need not be there.)
I want a terminal command that can batch process hundreds of images and add its own filenames in its respective images.
I am using Linux Mint 17.
Something tells me that imagemagick can be useful, but I don't know scripting.
It is easy to put a single common text in all images. but I don't know how to put unique filenames as the text in the respective images in one go.
Best Answer
mogrify
does batch processing so you could use something like this (change the font, size, color, position etc as per your taste):to add the file name without extension (
%t
) to alljpg
s in the current dir, e.g.orca-lm-1.jpg
:This will overwrite your files so make sure you have backup copies.
If you use a different format (e.g.
png
) for the output files then the original files will remain unchanged: