iPhoto opens its doors to developers

I use iPhoto a lot to manage my family pictures, and I can see how iPhoto could be a very useful management system for scientist manipulating a lot of images. However, iPhoto was not exactly designed to fit scientists' needs, and without any plug-in system, there was no chance to make it more science-friendly.

Last week, Apple finally opened a few doors in iPhoto. With the release of iPhoto '08, Apple has also published public APIs for the developement of iPhoto export plug-ins. For scientists, that means potentially a better integration of iPhoto into their workflow: export to specific formats, image analysis, quantification, layout of fluorescence microscopy images... If you have some more specific ideas, share it in the comments, and maybe one of us will give it a try. That could make for an interesting tutorial.

Read below for more...

Interestingly, Apple has had built-in iPhoto plug-ins for a while, but the APIs were private. This did not stop adventurous developers to build plugins such as iPhotoToGallery, FlickrExport or Google's Picasa Web Albums Exporter. The private APIs were in fact already quite public, as iPhotoToGallery and FlickrExport 1.x are open-source, and the private APIs were recently discussed by Fraser Speirs on Late Night Cocoa. Why did it take so long to make the APIs official, and what does that tell us about Apple application development? Opening an app like iPhoto for plugin development is certainly beneficial for Apple, as it makes the product and the platform more valuable. But it is also a commitment for them, and it adds a additional layer of complexity to the developement effort. Each new version will now have to be compatible with these APIs. And it seems iPhoto is finally mature enough to deserve an SDK and a plug-in architecture. But what other parts of iPhoto would you like to see open? What about other applications? Which applications would you like to see Apple open up to plug-in development, that would be useful for your scientific needs? Post it in the comments below, and send a feature request to Apple!

The APIS

If you are interested in developing a plug-in, you should first download the SDK from Apple Developer Connection (you will need to create an ADC account, which is free). Then follow the Downloads link on your account. It comes with a 26-page documentation, and a 20-page tutorial, and everything seems quite straightforward. I give here a brief overview.

The exposed APIs are Cocoa/ObjectiveC code. The main class of your plug-in has to follow the ExportPluginProtocol. It is in charge of talking to the NSBox that you have to create in Interface builder, and that contains all the UI. Your main class is also in charge of performing the actual export. To communicate with iPhoto, your class is passed a special object in its init method. The class of this object is not public, but it does follow the ExportImageProtocol protocol, with which you can obtain information about the pictures the user wants your plugin to export, using methods such as -(int)imageCount etc... When the time comes, it is thus up to your plugin class to collect that information and perform all the tasks necessary for the export.

For the sake of completion, one more little thing. You also have to use for your UI an NSBox subclass that follows the ExportPluginBoxProtocol, but it needs very little code, which will be the same for all export plugin. In some cases, you may have some additional custom code in there, it seems mostly to handle particular keyboard or mouse events.

So, if you think you can make the next iPhoto killer plug-in for science, or, well, you know, just something interesting for a handful of mad scientists, get the SDK!

NB: Hi! Charles Parnot posting here... I am a recent addition to the MacResearch team, which means I will be contributing on a more regular basis than the handful of tutorials I have published. I am thrilled to be part of this very active bunch of people, that have built this great resource for mac-user scientists. Not sure what I can really add to that, but I will try my best! I studied maths and physics in College, but then got interested in life sciences and obtained a PhD doing bench work in molecular and cellular biology. I have been in academia for a while, and I am now in a biotech company. What will I talk about on MacResearch? Well, I have a special interest in all things Cocoa. I am also an Xgrid user, and I will thus certainy be helping with OpenMacGrid. We will try to make OpenMacGrid even better, by helping you go to OpenMacGrid (more Xgrid tutorials to come), but also by bringing OpenMacGrid closer to you (more on that soon). I am also very interested in talking more about electronic notebooks. In the coming weeks, I will try to investigate more in this area, share my findings and find out more about what you readers are doing.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

iPhoto for Science?

I would be interested in hearing if anyone is using iPhoto for scientific analysis of images? I love iPhoto for managing our family photos, but for work I don't see how iPhoto can be the power, performance, and flexibility of a 'real' scripting or programming language.

Also, iPhoto seems to bog down at about 5000 photos on my MBP. The iPhoto Library directory is at about 10GB! That would seem to be a big performance hit as well...

iPhoto limitations

I agree that iPhoto won't be able to do much. But maybe the one thing that it could help with is with any sort of initial visual (human) inspection of a collection of pictures. Then, the pictures can be sent to whatever export module and thus to whatever more integrated and specific system you have. I don't do much microscopy but I have been tempted a few times to browse and sort the pictures with iPhoto.

Since iLife 2006 (or before?) iPhoto is able to handle images without copying them to its library. I never used that feature, but that would seem like a useful feature for the situations where you only use iPhoto as a small piece of a larger workflow.

iPhoto performance

I don't personally use iPhoto for my scientific images, although I know that quite some people do so (especially in combination with light microscopy images). My personal iPhoto library contains over 16000 images and I'm still quite happy with its performance on a MBP. The performance issues were quite big prior to iPhoto 6 but those have been largely resolved. Haven't tested the new iPhoto '08 but I can only imagine it to be further improved.

A pity the new SDK doesn't allow custom import, as it would allow for the import of more scientific formats (like microscopy stacks etc).

PS. Charles welcome on board!

iPhoto 08 fuctionality

There is a fantastic program called iPhoto Library Manager by Brian Webster that greatly increases the functionality of iPhoto.

It lets you manage many iPhoto librairies instead of just one unwieldy library.

I create an iPhoto library for each photo shoot by client & by date. Then I archive it by year.
Access is fast!

re: fitzgeraldsteele iPhoto for Science?

There is a fantastic program called iPhoto Library Manager by Brian Webster that greatly increases the functionality of iPhoto.

It lets you manage many iPhoto librairies instead of just one unwieldy library.

I create an iPhoto library for each photo shoot by client & by date. Then I archive it by year.
Access is fast!

re: fitzgeraldsteele iPhoto for Science?

There is a fantastic program called iPhoto Library Manager by Brian Webster that greatly increases the functionality of iPhoto.

It lets you manage many iPhoto librairies instead of just one unwieldy library.

I create an iPhoto library for each photo shoot by client & by date. Then I archive it by year.
Access is fast!

re: mek iPhoto performance

There is a fantastic program called iPhoto Library Manager by Brian Webster that greatly increases the functionality of iPhoto.

It lets you manage many iPhoto librairies instead of just one unwieldy library.

I create an iPhoto library for each photo shoot by client & by date. Then I archive it by year.
Access is fast!

Re

I guess that college students can enjoy the life and relax, just because the quality writing services will assist to write the custom comparison essay of high quality.