Friday, September 24, 2021


Submitted by Gerald (Gerry) David Photographers think about this a lot. As a matter of fact, I have lists of what needs to be in my bag for different types of off-site sessions. I can usually remember everything important without the list… and then I get dust on my lens. And I forgot the cleaning kit. Or I find a cat hair on my sensor. And I forgot my blower. You get the idea. I did the same thing as a musician. Lists. They work.

What about computer technology? What do you have in your bag? Let me tell you about something I have in mine, and hopefully it will spur you into discovering better processes for your own work.

One thing I have discovered about 2021 is that people are addicted to GUI. For those that don’t know, GUI is an acronym for Graphical User Interface. It’s what the user “sees” on the computer screen. Some GUI’s even go so far as to make “programming” easy for you. For example, what you see when you open Lightroom or Photoshop is the GUI. When you activate a brush tool, choose a colour, and set all the variables, you are telling the GUI what to set up for your next action.

GUI’s that make extremely difficult things much easier tend to have the most value. Think about it. Microsoft Office. Photoshop. Protools. But if you were abnormally smart, and maybe a bit crazy, you could go in and use code to manually alter all of the pixels in your images, one at a time, using nothing more than your basic computer terminal. FYI – don’t try it.

BUT... some things are better and faster when done on your computer “terminal”. It’s actually called terminal on a Mac, command prompt on current Windows. In this format, you are talking directly to your computer brain. Somewhat!  The terminal app is itself a GUI, just an ugly one that doesn’t have menus or help you in any way. The lack of extraneous menus and visible junk mean that everything you do here will be faster.

An example for you…

In my role on the World Photographic Cup committee, one of the things I have to do is take 400 images and rename them so that there is no chance that a judge can figure out who’s image it is. Ideally, the images should have “random” names. This can’t be done willy-nilly. The method must include the ability to cross-reference back to the image. If an image gets named 893452.jpg, I have to be able to have a record saying that image was originally portrait_smith_john_01.jpg. This is a herculean task to do manually.

The data for the images such as filenames, makers name, makers ID are all located on an Excel spreadsheet. Note that this information is dislocated from the file itself, but should match the filename. This is why I get so hyper about filenames!!!.

I ask myself this question. Is there a way to rename and move files in a bulk fashion based on the data I have on a spreadsheet and the filenames themselves?

The answer is YES, and the process below is what I cobbled together. Note that there are other ways and some are better or worse. This is what I settled on due to it’s simplicity. Also note that this blog is a very light version of the process itself. It’s only here to make you think, not give you precise instructions. I am NOT going to give you details here. It would be much easier for me to record my screen while I do it in order to show you. So I will just talk about the basics. But if you have a task like this, I’d be happy to advise you.

The basis of the task begins with Excel, itself an amazing program with a wonderful GUI.

Column headings are created for all the data with first name, last name, member ID which I assign, and the original filename. From the original filename, I can tease out the category and image number. Again, filename structure is important as well as verification with the member name.

Once the data for all the images is in a table with headers, a random number is assigned to each image. Note: this is not as easy as it looks. Even with a 5 digit random number, repetition almost always occurs every 200 or so images. There is a way around this, but it’s complicated. So I won’t get into it.

Once all the data is laid out, the fun begins. A person familiar with excel can do this in minutes. Of all the data I spoke of above, this is what I take out and use. The last column is what I create using a simple formula. It may not appear so simple, but when you understand it, it is.

From that, I create a new column that assembles all the data into a command line:

MV(space)/users/desktop/WPC_2022/original_images_copy/Nature_smith_john_01.jpg(space)/users/desktop/WPC_2022/renamed_images 3_981734.jpg

NOTE – In Linux (which is what Macs use as their language) MV is the MOVE command.

I cut and paste that command line into terminal, hit enter, and terminal moves and renames my file. Yes, not only can it rename the file, but it also moves it into a different folder.

IMPORTANT NOTE: I only ever work with a copy of the file. All of the original files are kept in a folder called original_images. Every time I do a task, I copy the folder and name the new folder after that task, in this case renamed_images. ALWAYS work with a copy!

Hmmm… ok, that was a lot of work. For 1 image. I have 400.

The beauty of doing all of this in Excel is that you can actually create and cut and paste 400 of these command lines into a terminal, and then hit enter!

And 400 images get renamed to exactly what you want them to be very quickly. And the Excel worksheet keeps your cross-reference, so you always know what image belongs to what person.

Think of the tasks that you do every day, and think about some that could be made easier with a method like this. I have used similar methods to create multiple folders inside another folder. I have used it to change an extension.

If you are just renaming a file and the rename is simply a FIND and REPLACE, there is a renaming tool with Mac OSX and Windows. And they are easy and work well. But sometimes you find yourself with a task that they just cannot handle, and you have to get out the big guns . . . Welcome to terminal. Put it “in your bag”.

Gerald (Gerry) David has multiple PPOC accreditations, including animal sporting events, animals, botanical, image manipulation, and performing artists. He also has his Master of the Photographic Arts (MPA), and Service of the Photographic Arts (SPA). Gerry is well known for his service with accreditation, salon competitions, and is the WPC Team Canada Co-Captain. He is always available to answer your questions, and offer encouragement. I’ve often heard “What would be do without Gerry?”





Person icon