Back in the old west before the dawn of digital cameras, you could get your photos transferred to a Kodak Photo CD for everlasting storage. Like other proprietary formats, PCD lost out to the next generation and left those who believed in it behind.
Well, fast forward fifteen years and I have just located an old Kodak Photo CD, looking to browse it’s content. Thanks to reverse engineering we have a few options when it comes to converting the pictures to a more usable format.
The next section will demonstrate the converting process using ImageMagick (http://www.imagemagick.org/) and pcdtojpeg (http://pcdtojpeg.sourceforge.net/). You’ll need to have ImageMagick and a C++ compiler installed to be able to follow the examples below. With a multi-usage distro like, say Slackware Linux, all is provided for out of the box.
Converting PCD files using ImageMagick
Navigate to the folder containing your PCD files and run the following command:
mogrify -colorspace RGB -format jpg *.pcd
With the mogrify command above, the original images are left untouched and the copies are stored in the JPEG image format. The reason why the PCD image format is indexed (pcd) is because the file contains the same image at 6 different sizes. Using “index = 5” will provide us with the image with the highest resolution. The “-colorspace RGB” option is needed in order to get the colors right according to the ImageMagick documentation.
Converting PCD files using pcdtojpeg
pcdtojpeg boasts the following features:
- No blown highlights
- Converts at full resolution
- Correct color
- Extracts metadata
- Fast processing
Navigate to your home folder with the command:
Download pcdtojpeg with the command:
Unzip pcdtojpeg with the command:
Enter the pcdtojpeg src directory with the command:
Compile pcdtojpeg with the command:
g++ main.cpp pcdDecode.cpp -ljpeg -lpthread -o pcdtojpeg
Move the pcdtojpeg executable to your home directory
mv pcdtojpeg $HOME
Export the home directory to the PATH variable so we can run pcdtojpeg from any location (for the current session only).
Now lets navigate to the directory containing the PCD files and convert them using pcdtojpeg.
The following command loops through all the PCD files in the current directory and convert them to JPEG files.
for i in *.pcd; do pcdtojpeg $i; done
Have a look at the documentation at http://pcdtojpeg.sourceforge.net/Usage.html for more advanced usage, though the default implementation seems to be optimized enough for my needs.
To compare the results, I have attached the exact same image converted with both ImageMagick and pcdtojpeg at a maximum resolution of 3072×2048. The motive of the picture is the Roman Colosseum.
In a sad turn of events, Kodak has just filed for bankruptcy. Signifying perhaps the unavoidable faith for most proprietary formats..