Monday, June 19, 2006

Waiting for Aperture and iPhoto Support: Modified Resources for Pentax *ist DSLRs

Edits: Corrected blog entry label. Since OS X 10.4.9, the *ist DS2 and DL2 are now the only Pentax DSLR cameras not officially supported. - March 16th, 2007

Mac OS 10.4 ("Tiger") has built in tools to open RAW files with the Preview application, but most Pentax DSLRS haven't been able to use them. Apple's iPhoto has had limited RAW support for a while now, and Aperture 1.1 is Apple's flagship RAW management application, but they only support the *ist D. That's right. As of OS 10.4.6, Apple currently only supports the .PEF format for the *ist D, a three year old camera. All the other Pentax DSLR cameras have been shut out of the playground for quite a while.

Apple's Aperture For G5 and Intel Macs

The good news is that a Mac OS update is due any time now to add more support for digital cameras, like current Pentax DSLRs. The bad news is that if you can't wait, the only non-third party solution* is to get under the hood and edit some of the XML settings used by OS 10.4 to cheat and get the operating system's native RAW support to recognize your .PEF files. So far, the methods work best with the *ist DS and DS2, and the limitations expose more problems with a DL or DL2, but it does open the door.

How to modify the resources

If you have OS 10.4.6 or later, but don't have support for your Pentax's .PEF format, the trick is to dig down to the .PLIST settings text file that Apple's RAW support looks into when opening RAW files, and to create a custom entry for your camera, such as the *ist DS. Brought to you by Karl Geiger from the Aperture Forums, with my special thanks to Peter Gnemmi, here's a recipe for getting your DS .PEFs into iPhoto and Aperture.

Step 1. Locate the "Raw.plist" file on your hard drive:

System/Library/Frameworks/ApplicationServices.framwork/
Versions/A/Frameworks/ImageIO.framework/Versions/
A/Resources/Raw.plist

Step 2: Duplicate the file, creating "Raw.plist copy," to save a backup. Safety first, kids!

Step 3. Open "Raw.plist" in TextEdit, or a simple text editor of your choice, like TextWrangler or BBEdit.

Step 4. Look for the text string "*ist D" and change it to your camera's name, such as "*ist DS2". Edit: If you have OS 10.4.7, the entry of the DL already exists and is appropriate to modify for the DS, DS2, and DL2.

Karl points out that this "will change *ist D compatibility to *ist DS compatibility", but "that means that Aperture can't read *ist D files anymore. If you want to be able to read both, just copy the entire "*ist D" section and paste the copy directly below the "*ist D section"; just modify either of the sections."

Step 5.Edit: If you have changed the DL's Raw.plist entry instead of the D, you no longer need Step 5 and can skip to step 6. Now you need to modify the color calibration settings or you'll get very skewed colors, similar to cross processing. The settings for the *ist D are unique for that camera, so any other camera will have different color information keys, and so far the key area m2 is the only one that people know how to change to be appropriate for the *ist DS instead of the *ist D, thanks to DCRaw.

Change the values in "m2" to read:

<key>m2</key>
<array>
<real>1.0371</real> <real>-0.2333</real> <real>-0.1206</real>
<real>-0.8688</real> <real>1.6231</real> <real>0.2602</real>
<real>-0.1230</real> <real>0.1116</real> <real>1.1282</real>
</array>

Step 6. Repair permissions and privileges on your HD, and then give it whirl!

Karl explains how the method came about:

When I got Aperture, I started reading the Apple forums. There I read how people had played around with the Raw.plist to add the Leica Digilux-2 to the Raw.plist. I took a look at the Raw.plist and found that the *ist D was there already. I then changed that entry to read *ist DS (see step 2 above). However, the colours were a bit off. Next, I read about DCRaw on which many Raw decoders are based, downloaded the code and lo and behold! the values for the "m2" table of the *ist D entry in Apple's Raw.plist are exactly those contained in DCRaw. Since DCRaw also takes care of the *ist DS, all I did was take the *ist DS values from DCRaw and put then into the "m2" table in the Raw.plist.

Very cleverly, DCRaw saves a tiny amount of space by not storing decimal valus ("1.0371"), but storing values without the decimal point ("10371"). So I added the decimal point for my modified Raw.plist.

This trick is not sufficient for making Aperture read *ist DL files. Other people on the Aperture forums have modified yet another system file to add *ist DL compatibilty*.

Chances are that under extreme light conditions such as low candlelight in a restaurant at midnight, your colours will turn out a bit off. However, for the life of me I can't find out the proper values for "m1" or "mc". Nevertheless, the modification works very well. Look up my photos on flickr and judge for yourself.


* The third-party solution: If you convert your .PEF to a digital negative file (.DNG), Adobe's proprietary open format, Aperture will recognize most all the embedded .PEFs inside and their color settings. It's not always guaranteed, but it works for many.

Links: Apple Aperture 1.1.1 ($299), Apple's Aperture Forums, TextWrangler, Adobe DNG Converter For Mac, DCRaw

18 comments:

gestaltungswille said...

It works, great!

Gestaltungswille

Anonymous said...

Is 10.4.7 really going to support pef? Is this confirmed?

Hudson said...

Works seamlessly, I had a few emails back and forth with Karl while my Macbook Pro was on its way and I had everything ready to go when it arrived. I saw this post on the Aperture forums about 3 weeks ago.

OK-1K said...

Karl and I worked to put this together on the blog with simple instructions, so I'm glad it works for everyone. There's never any confirmation from Apple until it's there, so let's all be patient and scream at them in the meanwhile, okay?

Anonymous said...

Anyone got this to work for the K100/110D?

Anonymous said...

aperture crash while working a few pef file. and there is no problem with nikon nef file, anyone have the same problem?

Anonymous said...

10.4.8 and still no support??

gah, converting to DNG for me...

runlevel0 said...

THX a lot, neat hack!
I just discovered your blog a few hours ago and find it real useful as I am both a Mac and *ist DL2 user.

Scott Lamb said...

I upgraded to 10.4.9 today. The release notes said "improved RAW support". Tried it out...success! iPhoto now imports my Pentax K100-D's .PEF files.

Rory Sinclair said...

Ok, this doesnt work with Leopard, as there is no Raw.plist file to edit.

To combat this, I am now converting my DL2 pefs to look to the OS like they're DL files.

vim -b -c ":%s/*ist DL2/*ist DL /g|:wq" filename

is the magic incantation to do this.

Anonymous said...

I just upgraded to OS 10.4.10, and this doesn't work for my *ist DS2 images: I get an error message from iPhoto saying the import failed. I'm pretty sure I followed the instructions for modifying Raw.plist correctly; any suggestions?--Thanks. (I'd love to make this work and am very appreciative of the effort people have put in.)

Tigger Fox said...

I also cannot import *DS2 files under 10.4.10. Neither Preview nor iPhoto can read them. Any indication that this is an issue with 10.4.10 only?

Equipment is:
Pentax *ist DS2
Mac Pro 2x2.66 OS X Version 10.4.10
iPhoto '08 Version 7.0.2

(Holding off on Aperture until it will read my .PEFs. Back to Bridge for now.) Thank you for all the help - it's nice to see that at least Pentax's _users_ haven't forgotten about this camera.

Dave said...

actually there is still a raw.plist, its just moved! It is in /system/library/coreservices/rawcamera.bundle/contents/resources. To open the rawcamera.bundle just ctrl click on it and select "show package contents". Hope that helps people that the raw.plist edit worked for. I have a DL2 also, but unfortunately this edit does not help me. Does anyone else know another way (beyond re-labelling the files as DL)?? Please drop me an email on davepalethorpe@gmail.com. Thanks!!

Dave said...

sorry the file location was too long to fit on one line! It is /system/library/ coreservices/rawcamera.bundle/ contents/resources

sorry!

tdmsu said...

This may sound silly, but how do I get to the system/library?
The only library folders I can access do not contain coreservices folders...

please help!

Dave said...

There are two "library" folders. One under your "user" name, and one under the OS X "system" folder in the root directory...ie if you open macintosh HD.

Dave said...

I have written a simple applescript application that will convert all DL2 PEFs in a selected folder to DL PEFs that OS X...and therefore Aperture.. will be able to recognise. If you want me to send you a copy, just email me on davepalethorpe@gmail.com

Hopefully this will help other DL2 owners out there!!

Dave said...

ps. This applescript application also works with DS2 cameras!

All Labels For This Site (Alphabetical)

© 2006-2011 by OK1000 Pentax Blog. All rights reserved. OK1000 Pentax Blog is not affiliated with Pentax.