Which Board? > Articles

The Contraption 26: Border Creator

(1/3) > >>

Francois:
This is a project that was prompted by the one and only Damion Rice!
He wanted to add a white border to a ton of photos before sending them off to print. But only problem he had, he only has access to Photoshop Elements. That might not seem like much of an issue but Elements lacks the possibility to create action scripts. When you have to modify 50 to 100 images at a time, lets just say it ain't the best solution. So I made him a small action script to do the job. But I wasn't happy with what I had done. It's not that the script didn't work but the fact that I know how slow Photoshop is at running scripts. I wanted something faster, leaner, meaner.

So, I set out do do something I like: create a script that does one thing and one thing only at breakneck speed.
So, I settled on using a tried and true app for the image manipulation engine: ImageMagick.
ImageMagick  is an image manipulation program that is run from the command prompt. No interface, just commands you type in. This might seem like a bad thing at first sight, but when you want to script an operation, it's perfect!

So, I set out coding the script.
I first went through previous programs that I have been improving on for years in order to find some good building blocks. I also decided to jump at the opportunity to improve on some other scripts.

I needed to find a way to make the script work with both dropped folders and dropped files, something that isn't obvious. I also needed to avoid permanently modifying the original files. In the end I opted to copy the files to a temporary folder, modify them there and then move them to a new folder in the same directory as the original. A bit convoluted but a better solution... though I really could have speeded it up by copying the files directly to a new folder and working on them there... maybe for some other update.

The script also resizes the images to fit a 6 inch side in either portrait or landscape. It also lets you select the border width and it's color.

So, here is the link to the first version of this thing (version 0.1)
https://drive.google.com/file/d/183mn4Pc1NgRyov7KBBnWuLX1iKQv964a/view?usp=sharing

If you can think of ways to improve on it, let me know.

Adam Doe:
Is it an executable or does it need a runtime?

Francois:
It's a script, so in a way it's executable but not really an executable in the way you think of (it's not a binary).
It's just a series of commands that call an external executable to do all the dirty work.
It uses ImageMagick (https://imagemagick.org/) which is an open source application that's been around for so long I can't remember. It actually started in the Linux/Unix world but can now be installed on anything.

If you download the script, you can open it directly in notepad (something you can't do with a regular binary executable) and see how it works.
I've included plenty of rem comments explaining stuff. The language used is pretty easy to follow and well documented.

I just do some clever scripting to get the final result.
I've worked a bit at beautifying the whole thing...

Francois:
I just uploaded a beautified version
https://drive.google.com/file/d/183mn4Pc1NgRyov7KBBnWuLX1iKQv964a/view?usp=sharing

This-is-damion:
how does it work though?   I open it and nothing happens....  can you pretend im a thicko  (not too far a stretch....) and explain in laymans terms how i use it?

Navigation

[0] Message Index

[#] Next page

Go to full version