TOPIC: TIFF
Batch conversion of DNG files to other file types with the Linux command line
8th June 2016At the time of writing, Google Drive is unable to accept DNG files, the Adobe file type for RAW images from digital cameras. While the uploads themselves work fine, the additional processing at the end that, I believe, is needed for Google Photos appears to be failing. Because of this, I thought of other possibilities like uploading them to Dropbox or enclosing them in ZIP archives instead; of these, it is the first that I have been doing and with nothing but success so far. Another idea is to convert the files into an image format that Google Drive can handle, and TIFF came to mind because it keeps all the detail from the original image. In contrast, JPEG files lose some information because of the nature of the compression.
Handily, a one line command does the conversion for all files in a directory once you have all the required software installed:
find -type f | grep -i "DNG" | parallel mogrify -format tiff {}
The find
and grep
commands are standard, with the first getting you a list of all the files in the current directory and sending (piping) these to the grep
command, so the list only retains the names of all DNG files. The last part uses two commands for which I found installation was needed on my Linux Mint machine. The parallel package is the first of these and distributes the heavy workload across all the cores in your processor, and this command will add it to your system:
sudo apt-get install parallel
The mogrify
command is part of the ImageMagick suite along with others like convert and this is how you add that to your system:
sudo apt-get install imagemagick
In the command at the top, the parallel command works through all the files in the list provided to it and feeds them to mogrify
for conversion. Without the use of parallel, the basic command is like this:
mogrify -format tiff *.DNG
In both cases, the -format switch specifies the output file type, with the tiff
portion triggering the creation of TIFF files. The *.DNG
portion itself captures all DNG files in a directory, but {}
does this in the main command at the top of this post. If you wanted JPEG ones, you would replace tiff
with jpg
. Should you ever need them, a full list of what file types are supported is produced using the identify command (also part of ImageMagick) as follows:
identify -list format
PSP file gotcha
29th January 2007Having completed my evaluation of Corel's Paint Shop Pro (a.k.a. PSP) Photo XI, I dutifully uninstalled it from my system. However, on catching up with some files that I had acquired through the application, I found that I could not open them with its forbear PSP 9. From this, I would have to conclude that Corel made a change to PSP's native PSPIMAGE file format along the way. Having had Windows 2000 installed in a VMware virtual machine, I got back PSP XI to batch convert the files into PSD (Photoshop's own file format) and TIFF files for the future. Carrying out the conversion was easy enough thanks to being able to select files according to their file type, something that Adobe could do with bringing into Photoshop Elements; it's not there even in the latest version.