Pages

Monday, May 12, 2014

Adding Borders to Pictures

Besides being a programmer, I like taking pretty pictures (and working with wood, but that’s another story). And from time to time I like to print some pictures and hang them on a wall.

Because framing pictures is expensive and, frankly, most of them don’t deserve it, I like to print a “virtual frame” – a thin black border followed by a wide white border – around each photo. Until recently, I was adding them in some stupid program I found on the Internet (it doesn’t deserve to be named), but I was always having problems because you had to specify border width in pixels – and if I wanted to set the same border (for example, a 1,5 mm black border followed by a 20 mm white border) for a set of pictures in a different resolutions, I had to calculate pixel sizes for each photo, which was a pain.

So I sat down and wrote a border-adding program. It allows you to specify border sizes in “real” measures, it can process one picture or a folder full of them and it can add a suffix to processed pictures (plus it will skip files containing this suffix if they are found in the source folder) and that’s about it. It is small, simple, solves a real problem and – what I found the most impressing – I wrote it in a single working day. Truth to be told, I needed about a month of work – an hour here, 15 minutes there – but all together I needed less than eight hours. That is the power of Delphi!

If you have a need for such tool, go ahead and download it from my Dropbox. You can also get the source, which is released to a public domain (i.e., do with it whatever you want). It depends on few external libraries, which are all released with an open source license: JCL, JVCL, GpDelphiUnits, OmniXML. At the moment the GUI is written in VCL, because I really didn’t want to spend too much time on this project and I know VCL by heart, but if somebody wants to go ahead and rewrite it in FireMonkey, I certainly won’t stand in his/her way.

image

image

4 comments:

  1. Anonymous10:05

    Lightroom does an excellent job to print photos, understand color spaces, and costs 1/10 of Delphi....

    ReplyDelete
    Replies
    1. I'm using Lightroom in my workflow, but I don't do printing; I'm merely sending files to my favorite printer. I'm much happier with my own tool for adding borders.

      The cost here is irrelevant - they are two different tools for two different markets. Plus I didn't buy Delphi just to wrote that tool.

      Delete
  2. Anonymous12:43

    But can Lightroom also keep track of your DVDs and BDs?

    ReplyDelete
  3. Anonymous12:54

    Do you still buy DVDs? But Lightroom keeps tracks of all my photos and videos - stored in my NAS... and I don't have to code SQL to retrieve them ;) And its photo tools are non-destructive. That's would be an interesting exercise in Delphi - implement a non-destructive image processing application. Maybe able to interface with Windows ICC or its Apple equivalent for color management... opening an image is easy - displaying it properly on every device is not.

    ReplyDelete