darktable icon indicating copy to clipboard operation
darktable copied to clipboard

Plug-in mode on macs to allow integration with Apple Photos

Open garethwebber opened this issue 1 year ago • 7 comments

Darktable currently works like adobe ligtroom in that it is both a DAM and an image editor. On Macs there is a default DAM in apple photos that provides multi-device syncing which is very attractive. As the moment, my workflow is import DNG into apple photos, export as original, import into darktable, work on file, export and delete from lighttable and load back into photos.

Apple has provided a way for image editors to make themselves available as plug-ins in their DAM so the export / import steps are hidden from user.

Can we add a mode to darktable to do the same including the plug-in registration?

garethwebber avatar Mar 08 '24 09:03 garethwebber

a simple solution to your needs w/o requiring any development work on darktable would be to run darktable as: darktable --library :memory:

this way no entries in your ~/.config/darktable/library.db (or where-ever macs locate the library) and you can directly edit your photos from the mac application by designating your editor as indicated.

gud luk

ptilopteri avatar Mar 08 '24 14:03 ptilopteri

#15398 has an example of how you can create a pseudo-app that launches darktable with the "--library :memory" option.

Donatzsky avatar Mar 09 '24 11:03 Donatzsky

Thank you both. This partly solves my request.

I will definitely use your comments in meantime.

While the comments remove the library management on the darktable side but still leaves export and import into photos.

Apple provides a plugin mechanism to do this that some third party photo editing software use. It was this also I was suggesting.

garethwebber avatar Mar 09 '24 13:03 garethwebber

While the comments remove the library management on the darktable side but still leaves export and import into photos.

using "--library :memory:" there is no "import into photos" but merely darktable accessing subject photos, ie: import.

"export" applies your changes to the raw into a generated jpg/png/...

ptilopteri avatar Mar 09 '24 13:03 ptilopteri

Apple provides a plugin mechanism to do this that some third party photo editing software use. It was this also I was suggesting.

I don't think any of the developers use Macs themselves, so it probably won't happen anytime soon unless you or someone else puts in the work. In any case, more information is needed on the interface.

Donatzsky avatar Mar 09 '24 17:03 Donatzsky

Ok. Thanks. May take a look myself.

https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/Photos.html

garethwebber avatar Mar 09 '24 17:03 garethwebber

I had a look and that kind of extension is not going to work with darktable.

A Photo Editing extension should make it easy for users to make quick, targeted adjustments to a photo or video without requiring too much user interaction. If you want to enable a more generic task or help users share photos and videos with others, the Photo Editing extension point is not the right choice.

There's apparently an "Edit With" feature, which would be much more likely to work.

Donatzsky avatar Mar 09 '24 20:03 Donatzsky

I had a look and that kind of extension is not going to work with darktable.

A Photo Editing extension should make it easy for users to make quick, targeted adjustments to a photo or video without requiring too much user interaction. If you want to enable a more generic task or help users share photos and videos with others, the Photo Editing extension point is not the right choice.

Does that mean this issue should be closed?

victoryforce avatar Apr 26 '24 14:04 victoryforce

Piggybacking, but the "Edit With" feature of Apple Photos relies on the following workflow:

  1. In Apple Photos user selects a photo then "Edit With" -> "Some App"
  2. Under the hood Apple Photos exports the photo in the highest available quality + metadata from internal database into a filesystem directory; it watches the exported photo file for changes
  3. The "Some App" editor is opened with the path form [2]
  4. User edits the photo
  5. User saves the photo overwriting the original path
  6. Apple Photos notices the change and performs necessary steps to update the photo in its internal database

Please correct me if I'm wrong but while "--library :memory:" only partially helps with this. It does make the darktable's database transient but the end user still has to fidget with the export workflow by manually editing file format and location.

For this approach to work smoothly darktable should automatically save the final edit by overwriting the path given by Apple Photos.

Kentzo avatar May 03 '24 21:05 Kentzo

darktable is non-destructive editor, targeted mostly at raw development. The workflow you described is basically the opposite of darktable’s purpose. Furthermore I don’t think there’s any interest from developers to integrate with proprietary software. There is though some integration between gimp and darktable.

parafin avatar May 04 '24 05:05 parafin

Apple Photos exports in TIFF (although I’m not 100% sure this is always the case), which fits “raw development”. Apple Photos also takes care of tracking changes and maintaining the original, so the net effect also fits “non-destructive”.

I understand that darktable is built around its own library, but if the devs will consider smoother “integration” of the editor part with Apple Photos, an in-place editing mode via filesystem path is definitely much easier and portable approach than proprietary Apple API.

Kentzo avatar May 04 '24 13:05 Kentzo

I also want Apple Photos integration, so I made a small app that adds "Edit with darktable" to the Photos app.

You can watch a demo here.

This is my first "real" macOS app, so it took me longer than I thought it would. Also the code could probably be improved. It saves the XMP data as metadata in Photos, so if you edit the photo again all of your history is preserved. Right now I made it just shell out to darktable. If there is a way to communicate with a currently running darktable process, I think that would help. (There might be a way to do that, I've done no investigation yet 😅)

tenderlove avatar Feb 03 '25 02:02 tenderlove