$whoname
Greg's photo processing
Greg's photography pages
Greg's photo albums
Greg's photos
Greg's photo index
Groogle
Work in progress
Work in progress

This page attempts to describe how I process and present my photos. Unlike most photographers, I don't use standard tools or web sites like Flickr or Picasa. Instead, I process things almost entirely my own way. Why? I think it gives me more flexibility. This is a first draft at describing what I do.

In the following document I frequently refer to specific URLs in a link. The link doesn't always go where the name suggests: the name is where things normally end up, and the link is where I've put the examples for this document (in http://lemis.com/grog/photography/processing/).

My files are available here. I only update them on request, so if you want them, let me know.

Photo tools

I have a directory /Photos/Tools with most of the scripts and programs I use for processing. This is in my path:

=== grog@eureka (/dev/pts/27) ~/Photos/20120712 13 -> set|grep Tools
MAKEFLAGS='-I /Photos/Tools'
PATH=...:/Photos/Tools
PHOTOTOOLS=/Photos/Tools

Getting the photos into the computer

My main camera is an Olympus E-30, and I take photos in raw format. I also have an old Nikon “Coolpix” L1 compact camera which I carry with me at all times. In each case, I connect the camera to the computer via USB, and for the Olympus I have a script called syp that recognizes the date code of the images and creates a directory for that date if necessary, with a name like ~/Photos/20120712/ and a subdirectory ~/Photos/20120712/. The files are then read into ~/Photos/20120712/orig/ if they're not already there:

=== grog@eureka (/dev/pts/27) ~/Photos/20120712 12 -> syp
Copying files from b:/dcim/377OLYMP to /home/grog/Photos
P7127469.ORF exists already
P7127470.ORF exists already
mcopy -pm B:/dcim/377OLYMP/P7127471.ORF /home/grog/Photos/20120712/orig/P7127471.ORF
mcopy -pm B:/dcim/377OLYMP/P7127472.ORF /home/grog/Photos/20120712/orig/P7127472.ORF
 Volume in drive B has no label
 Volume Serial Number is 0000-0000
Directory for B:/

DCIM        
    2010-09-06  16:35
        1 file                    0 bytes
                      7 957 348 352 bytes free

I don't currently do this with the Nikon because it's difficult to decide where the files belong, since they're just numbered sequentially. Instead, I use mcopy to copy them.

Creating JPEG images

Most of my processing is done with JPEG images. For the Olympus, I first need to create them. I do this with DxO Optics “Pro”, which only runs on Microsoft and Apple, so I run it in a virtual machine running Microsoft. For this I have two scripts fordxo and fromdxo. fordxo links all the raw files that don't have a corresponding .jpg file into a directory called /Photos/00-Oly (for no particularly good reason). fromdxo looks for the resultant files with the extension -DxO.jpg (for example P7127469-DxO.jpg in that directory and moves them to the orig directory with the suffix .jpg. So for the file name orig/P7127469.ORF I would end up with a corresponding file orig/P7127469.jpg. fromdxo also puts in my name as author and copies the other EXIF data from the .ORF file.

Contact prints

The next step is to assign names to the photos. I have two different ways to do this: the older script gn, which prompts for a name for each image. It's intended to be used in conjunction with a separate display of the images themselves. The newer version is web based:

=== grog@eureka (/dev/pts/21) ~/Photos/20120712 69 -> make contacts
mkcontacts -r
/home/grog/Photos/20120712

This builds a directory in /grog/localtmp/contacts/20120712 with the following page:


This should be contacts.gif.  Is it missing?
Image title: contacts          Dimensions:          1196 x 1109, 272 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Thursday, 12 July 2012, thumbnails          All images taken on Thursday, 12 July 2012, small
Diary entry for Thursday, 12 July 2012

 

I enter the names of the images I want in the fields below. There are a number of short cuts:

This script has little error checking. The comma and exclamation mark commands will do all sorts of silly things if the name they find doesn't conform to their expectations. But that's OK: you can always do it again.

Converting the files

Next the files need to be converted to a form for publishing on the web. That's the convert target:

=== grog@eureka (/dev/pts/27) ~/Photos/20120712 28 -> make convert

The contact print script has created a file called Makejpeg, which gets copied back into the top-level directory for the day. The make target uses this file to convert the images:

=== grog@eureka (/dev/pts/21) ~/Photos/20120712 71 -> l
total 7
-rw-r--r--  1 grog  lemis   885771 Jul 12 09:28 Grapefruit-1.jpeg
-rw-r--r--  1 grog  lemis   950419 Jul 12 09:28 Grapefruit-2.jpeg
-rw-r--r--  1 grog  lemis   999113 Jul 12 09:42 Grapefruit-3.jpeg
-rw-r--r--  1 grog  lemis  1126816 Jul 12 09:42 Grapefruit-4.jpeg
-rw-r--r--  1 grog  lemis  2951695 Jul 12 12:02 Jawi.gif
-rw-rw-rw-  2 grog  lemis      178 Jul 12 13:13 Makejpeg
-rw-r--r--  2 grog  lemis       34 Jul 12 13:13 description
drwxr-xr-x  2 grog  lemis      512 Jul 12 13:12 orig

Optimization

As the next step I run an old version of Ashampoo Photo Optimizer, another Microsoft-space program that I got for free some time ago. It frequently improves the appearance of the images. I haven't upgraded because the usage of the newer versions is even more emetic, and to get it to work at all in my environment (under Wine) I had to hack the binaries to get it to call its backup directory _Ashampoo_Photo_Optimizer_Backup instead of _Ashampoo Photo Optimizer Backup, and also wrote a script photoopt that links only the files that haven't been optimized to a new directory ~/Photos/Bloody-stupid-ashampoo, and then starts Wine pointing at that directory so that you can select all files and optimize them all. It then moves them back to the base directory (optimized versions) and the directory _Ashampoo_Photo_Optimizer_Backup (originals) and creates a comparison web page http://lemis.com/grog/photography/processing/compare.php with the original on the left and the optimized version on the right. Running the mouse cursor over the “before” image shows the “after” image for better comparison.

If any of the “optimized” images turn out to be worse, the simplest way to fix it is to move the file in _Ashampoo_Photo_Optimizer_Backup back to the base directory.

Generating the photo web pages

When all that is done, it's time to generate the web pages:

=== grog@eureka (/dev/pts/27) ~/Photos/20120712 29 -> make web

This performs the following steps:

The photos can be viewed via the web page http://lemis.com/grog/photos/Photos.php?dirdate=20120712. The dirdate is the only thing that it needs to locate the images.

Embedding photos in web pages

The code for the web pages is in PHP. The main function is showphoto():

      <?php showphoto ("Photos/20120630/garden-path-se-old.jpeg",
                       "Photos/20120630/garden-path-se.jpeg"); ?>

Normally only one parameter is used. It implicitly takes the user's base directory (http://lemis.com/grog) and appends the name. Note that it's not a complete relative path name: the real photos are in Photos/20120630/tiny/garden-path-ne-old.jpeg, Photos/20120630/small/garden-path-ne-old.jpeg and Photos/20120630/big/garden-path-ne-old.jpeg. If there's a second parameter, it's a “comparison image”: when JavaScript is enabled, running the mouse cursor over the image causes it to change to the second image. Here's the code above in action:


This should be garden-path-se-old.jpeg.  Is it missing?
Image title: garden path se old          Dimensions:          9345 x 2671, 7744 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Saturday, 30 June 2012, thumbnails          All images taken on Saturday, 30 June 2012, small
Diary entry for Saturday, 30 June 2012 Complete exposure details

 

Other features of showphoto () are:

Other functions

The image display functions are in php/includes/onephoto.php, currently 2,400 lines long. Interesting ones include:

JavaScript and PHP infrastructure

For all this magic to work, I have a number of functions for web pages. The easiest way to show it is with an example of the header and footer of a typical page such as my skeleton file http://lemis.com/grog/skel.php, also available in non-processed form:

<!-- for Emacs, this is a -*- mode: html-fill; coding: utf-8 -*- document -->
<!-- $Id: processing.php,v 1.3 2013/09/14 23:44:58 grog Exp $ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<?php
   /* title should start with a lower case character */
   $title = "XXX";
   $subtitle = "";
   include "header.php";
   $id = '$Id: processing.php,v 1.3 2013/09/14 23:44:58 grog Exp $';
 ?>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <?php pagetitle ($title); ?>
  </head>

  <body>
    <?php pageheader ($title); ?>

    <div align="justify">
      <p>
XXX Place text here
      </p>
    </div>

<?php pagefooter ($id); ?>

Installing the software

The tarball includes four directories:

Other stuff

I have many more scripts, including ones that make panoramas and HDR images. I'll document them some other time, probably not until somebody asks me about them.


Greg's home page Greg's diary Greg's photos Copyright

Valid XHTML 1.0!

$Id: processing.php,v 1.3 2013/09/14 23:44:58 grog Exp $