Archive for June 2011
Most Linux photographers use graphical applications like digiKam, Rawstudio, or darktable as their tools of choice for processing and managing photos. But it is possible to set up a photographic workflow built around command-line tools that can handle a wide range of photographic tasks: from fetching photos from your camera and convert RAW files to the JPG format, to backing up the photos on a remote machine and even publishing them on the web. Here is a sample workflow you can use as your starting point.
The first order of business is to set up a dedicated working directory for storing photos transferred from your camera:
Next, make sure that the gPhoto software is installed on your system. gPhoto is available in the software repositories of many popular LInux distributions, so you can install it using your distro’s package manager. On Ubuntu, this can be done using the sudo apt-get install gphoto2 command. Connect then the camera to your machine and run the gphoto2 –auto-detect command. If your camera is supported, the command should return brief camera info.
To transfer photos from the camera to the fotki directory, run the following commands in the terminal:
If your camera supports tethered shooting, you can use gphoto2 to automatically transfer photos from the camera as soon as you take them. To do this, use the gphoto2 –capture-tethered command.
Once the photos have been transferred, you might want to change their names to something more descriptive. One way to do this is to use the exiftool utility (on Ubuntu, you can install it using the sudo apt-get install libimage-exiftool-perl command). For example, the following command renames Nikon RAW files using date info from EXIF metadata:
exiftool -d %Y%m%d/%Y%m%d-%H%M%S.%%e "-FileName<DateTimeOriginal" *.NEF
If you shoot in RAW, the UFRaw utility can come in handy when you need to convert RAW files to the JPEG format. To install it on Ubuntu, run the sudo apt-get install ufraw command. Use then the ufraw-batch tool to convert RAW files:
ufraw-batch --out-type=jpeg *.NEF
The command above uses the default options for converting RAW files, and to get the best result, you might want to tweak them. For a full list of supported options, run the man ufraw-batch command. Here is an example of a more advanced ufraw-batch command:
ufraw-batch --wb=camera --rotate=camera --out-type=jpeg --out-path=jpeg/ nef/*.NEF
The good old rsync utility can take care of backing up your photos to a local destination, external storage device, or a remote server. For example, the following command backs up the fotki directory to a server on the local network using a secure SSH connection:
rsync -avhe ssh --delete ~/fotki user@remotehost:/home/user/fotki
Finally, if you want to publish your photos on the web, the llgal tool got you covered. It can generate no-frills static HTML galleries. As any command-line tool worth its salt, llgal supports a handful of options for you to tweak. The -R option, for example, can be useful if you want llgal to include subdirectories into the final gallery. To give the gallery a name, use the –title option as follows: –title “Garden Flowers.” llgal doesn’t generate thumbnails, so if the source directory contains large image files, it’s a good idea to limit their width and height to a specific size. This can be done using the –sx and --sy options. And you can use the –exif option to display EXIF metadata for each photo. To sum up, here is an example:
llgal --exif --li -L -R --title "Garden Flowers" --sx 800 --sy 600
To see a list of all available options supported by llgal, run the llgal –help command.
These are just a handful of tools you can use to set up a command-line photographic workflow on Linux. There are, of course, many other handy command-line tools out there you can incorporate into your workflow. Using, for example, the HDR script, you can automate the process of creating HDR images, while the Enfuse tool (it’s part of the Hugin software) can be used for focus stacking.
Using the commands tucked under the Import menu, you can offload photos from your camera, storage card, or USB stick directly into the application. What’s more, the Import dialog box offers a few clever features that allow you to configure the import operation. In the File Renaming Options section, you can define a custom rule which renames all incoming photos on the fly. Say, you want to rename imported photos using their date and time info pulled from EXIF metadata. Enable the Customize option, and select the Date & Time item from the Options drop-down list. From the drop-down list next to the Format field, select the desired date and time format. The available options include Standard, ISO, Text, UnixTimeStamp, and Custom. The latter allows you to specify your own data and time format. For example, enter the yyyyMMdd-hhmmss rule in the Format field to rename photos as follows: 19730921-175735.
The options available in the Auto-creation of Albums section can come in handy in several situations. If you are downloading photos taken on different dates, you can enable the Date-based sub-albums option and choose the desired date format. This will neatly organize imported photos in albums by date. The Extension-based sub-albums option can be useful for importing photos in different formats into separate albums. For example, if you shoot in both RAW and JPEG, you can enable the Extension-based sub-albums option, so photos will be imported into appropriate folders based on their file extensions.
Finally, the On the Fly Operations section allows you to configure several actions to be performed on the photos during the import process. Among other things, you can let digiKam autorotate photos and convert them to another format like PNG or TIFF.
The California poppy (Eschscholzia californica) is a perennial and annual plant, native to the United States, and the official state flower of California.
It can grow 5-60 cm tall, with alternately branching glaucous blue-green foliage. The leaves are ternately divided into round, lobed segments. The flowers are solitary on long stems, silky-textured, with four petals, each petal 2-6 cm long and broad; their color ranges from yellow to orange, and flowering is from February to September. The petals close at night or in cold, windy weather and open again the following morning, although they may remain closed in cloudy weather. The fruit is a slender dehiscent capsule 3-9 cm long, which splits in two to release the numerous small black or dark brown seeds. It is perennial in mild parts of its native range, and annual in colder climates; growth is best in full sun and sandy, well-drained, poor soil.
Full-size version and further info: http://commons.wikimedia.org/wiki/File:Eschscholzia_californica_(Shallow_DOF).jpg
It’s nice to have friends. It’s even better to have friends who support open source and put money where their mouth is. I’m proud to say that I have such a friend. Russell Ossendryver and his WorldLabel company do an amazing job of supporting the open source software movement and individual open source projects. His company’s blog often features articles by prominent tech writers covering Linux and open source software. And now WorldLabel has kindly agreed to sponsor a competition for the best digiKam tip, where the winner will bag a cool Ubuntu-based Teo Pro netbook from ZaReason.
The competition rules are simple: submit a clever digiKam-related tip or nifty trick in the comments area, and you automatically enter the competition. The only condition is that you release your tip or trick under the GNU Free Documentation License. Russell and I will pick the best entry on July 21 12:00 UTC. That’s all there is to it.
A few words about the competition’s sponsor
This competition is possible thanks to generous support from WorldLabel, the best place on the web to buy high-quality labels. WorldLabel carries an impressive range of Avery-compatible labels. Address labels, CD labels, mailing and shipping labels, multipurpose labels — WorldLabel got them all. In short, if you are looking for a good place to buy labels, WorldLabel should be your first stop.
Update: We decided to extend the competition until Monday, August 1 12:00 UTC. This should give you all a little bit more time to submit your amazing tips. :-)
The winner of the competition is Vincent from France. Congratulations!
While doing research for an article in Linux Magazine, I cobbled together a simple extension for the Google Chrome and Chromium browsers. This is a one-trick pony that fetches the latest RSS articles from this very blog and displays them in a popup window.
The extension is customizable, so you can replace the default Scribbles and Snaps feed with any feed you like. You can specify the number of RSS items to display, too. You can read about the extension and download its latest release at the Scribbles and Snaps RSS page.
If you happen to use the Chrome or Chromium browser and you are looking for an easy way to spice up your photos with vintage effects, the Lomo+ web app is right up your alley. Using the app, you can apply a wide range of high-quality vintage effects to any photo on the web without leaving the convenience of your browser.
Once installed, Lomo+ adds the Modify in Lomo+ command to the right-click context menu, and you can use this command to open a photo in a web page in the Lomo+ editor. While Lomo+ cannot open photos stored on your machine, you can work around this limitation by uploading the photo you want to give a makeover to Flickr or any other photo sharing service, and then open the full-size version of the photo in Lomo+. The Lomo+ editor puts 12 artistic vintage effects right at your fingertips. Click on the effect you like, and you will see the result almost instantaneously (the time it takes to process the photo depends, of course, on its size). To save the processed photo, use the Save Image command. Right-click then on the generated thumbnail and save the photo on your machine. That’s all there is to it.
When it comes to tethered shooting, Rawstudio is by far the easiest and most user-friendly solution on Linux. This powerful RAW processing application sports functionality which allows you to control and monitor the connected camera with a minimum of effort. The only requirement is that your camera is supported by the gPhoto2 software which acts as Rawstudio’s back end. Plug your camera into a USB port in your machine and make sure that the camera is not mounted (unmount it, if necessary). Launch Rawstudio, and hit F9 (or choose View » Tethered Shooting) to open the Tethered Shooting window.
Select your camera in the Select camera drop-down list, and press the Connect button to establish a connection between the machine and the camera. To check whether everything works properly, hit the Take Photo button. This should trigger the camera and automatically import the taken photo into Rawstudio.
Instead of triggering the camera from Rawstudio you can put the application into the monitoring mode by pressing the Monitor button. In this case, Rawstudio listens to the camera, and as soon as you take a photo, the application transfers the file to the machine. Rawstudio also supports so-called interval shooting, when it automatically triggers the camera at predefined time intervals. This functionality can be particularly useful for time-lapse photography. Using this feature is as easy as it gets: specify the desired interval in the Second between each shot field and press the Start Shooting button. The camera will keep taking photos at the specified intervals until you hit the Stop Shooting button.
Finally, in the Filename and Tags section, you can specify a naming rule and tags which Rawstudio automatically applies to each transferred photo. For example, the %DY%Dm%Dd-%t rule renames incoming photos using their date and time as follows: 19730531-23:59:59.NEF, 19730531-01:01:59.NEF, and so on. And if you specify rawstudio, macro, flowers and other tags in the Tags for new images field, they will be automatically assigned to imported photos.
This release includes the following new material:
- Assign Keyboard Shortcuts to Tags
- Configure the Main Toolbar in digiKam
- Host Your Own Photo Gallery with Piwigo
Readers who already purchased the book will receive the new version free of charge. If you haven’t received your copy, please send your order confirmation as proof of purchase to email@example.com, and I’ll email you the latest version of the book.