What it takes for darktable to run on mobile or web?

Firstly I’d like to say thank you to everyone involved in darktable, congrats for the 3.6 release.

This is not a feature request.
TLDR: Just go to the HOW? section if you are not interested to read all. The HOW section is really what my question is about.

I have two use cases that might be able to be solved should we can make darktable run on either web or mobile.

Use case 1
I have a large pile of personal, not very high quality RAW photos in my NAS. Around few thousand from the last two years or so. I use NAS because I don’t have enough local space. And I also like the idea of having my personal cloud that I can access anywhere. (Even from different workstations as long as I keep the path the same). The library.db is also stored in NAS.

I use darktable to post process, cull and tag. My processing workflow is slower than the number of photos I take on a single outing, so I keep adding more and more into my processing backlog. But this is not really the issue I want to talk about :smiley:

My problem is with photos stored in NAS, light table are slow to load. And thus culling and general DAM functionality are just slow. I think darkroom is doing just fine as I only operate on a single image.

Also, I like to view photos that I processed, rated, tagged, etc. I can do this via lighttable, but then again is slow process. I can export everything rated 4 or 5, then view it on another viewer (on my NAS photo viewer). But then I don’t have DT functionalities where I can just do another edit on that. I prefer to only have to export when I need to (e.g. when sharing photos or printing). For everything else, keep them in the master library unexported.

My humble idea:
If I can have darktable working on a server side in my NAS, then I can do my viewing, culling, rating, etc. web based. I assume the web based interface is nicer and faster than SMB protocol I use to open the library in NAS.

Also since DT can process the Light table thumbnails server side, I don’t need to stream RAW files to local before displaying. Huge win!

Use Case 2

My close relatives and family use Lightroom just because it is probably the best raw editor available in Smartphone. They like to take photos, transfer it to their phone, upload to lightroom cloud, process, then share on Instagram. It just so quick workflow from camera to Instagram :smiley: Occasionally they use the dekstop version to access the same files stored on cloud.

I tried to convince them to try DT. I showed them the way I use DT. They are not convinced since they primarily still use phone and the cloud storage.

My humble idea:

If we can make a web version of DT, it is probably a step closer to make it work on mobile. Same with use case 1, we can run it on our NAS as our personal cloud.

HOW?

Okay so this is really what my question is. I know developers may or may not be interested building such features, but I’d like to understand how we can achieve that. I know a little about web development (but struggling at math), if it is easy enough then probably I will make a start myself.

  1. Does DT have some kind of API where we can call? Is the processing pipeline really separated from the UI stuff? Is calling darktable processing API from PHP (with PHP-C binding) something feasible? Or maybe other web oriented languange binding?
  2. On web or mobile based (client server) model, is it better to run that processing pipeline in server side or in the client side?
    If we do it client side that means we need to rewrite that whole pipeline in the client side language :frowning: (javascript or native mobile platform)
  3. If the aboves are feasible, then most of the effort will be in the UI rewrite?
    If we want to start ‘lite’, maybe it is enough to just port the UI for some basic modules as a start. E.g. exposure, filmic, crop, color balance rgb, toneq. And obviously light table.

What do you guys think?

For use case 1: where are you storing darktable’s cache? It should be local and not on the NAS. Probably the same for the database, that’s why DT is slow, because samba is slow.

For use case 2: fastest way for a “web UI” would be to use a web vnc client or rdp to share the desktop to the web browser.

Any type of rewrite is going to be really time consuming.

You said mobile, but didn’t say apple or android. You’d probably want an app like that to be native.

How about setting up something like VNC on your NAS? Then nothing would need a rewrite.

Edit: @paperdigits beat me to it.

DT cache in local disk. Library in NAS because I use 2 computers where DT access the same library. The NAS software actually sync the library down to local disk, also it is small file so I doubt it caused the slowness.

I suspect generating the thumbnails is the one causing slowness as it needs all the RAW files. Despite the cache, it looks to me that DT keep rebulding the thumbnails every now and then (changing light table modes, zoom in/out, etc). But I could be wrong.

@elGordo mentioned about VNCing to the NAS (instead of desktop).
I’m not sure if I can run DT directly on the NAS. Are you suggesting something like installing a VM in the NAS with an X window, install DT in it. Then do the VNC?

I know rewriting anything would be huge effort hence my question is to understand the possibility of reusing certain code (processing pipeline) and only rewrite the limitted UI part.

Yes, or use a VM in the cloud.

I don’t use darktable with a NAS, but isn’t use case #1 covered by darktable 3.6 user manual - local copies?

I’m aware of local copies feature. In my opinion it partially covers use case 1, but not all.

It seems to be suitable when you want to “work” on a set of images, then you sync it back when you are done. An analogy is more like a partial checkout of an SVN repo, work locally, then commit.

While doing that, the rest of the collection are unavailable (or not get a benefit of the local copy). So less suitable for a more random access workflow.

Said that, I didn’t really try this feature. I’ll try to give it a go next time.

Just for fun, I’ve started RawTherapee with the Broadway GDK backend. Works surprisingly well…

1 Like

Is it important to you that the remote view be in a web browser? With a VNC or RDP client, you can have a full view of the remote desktop, with none of the browser UI parts in the way. I do my work all day, every day, remotely via VNC and/or RDP, and it’s “just like being there” without the commute or the interruptions. I’ve found the Remmina client to be very good.

This sounds like something they might use to go from camera to Instagram while out and about, without ever connecting to a computer at home. Is that correct?

There is a vast difference between “barely running” and “being usable in production”.

People make darktable run on Raspberry Pie. Cool.

Now, editing for real a 24 Mpx image without access to a solid GPU makes modules like contrast EQ, denoise profiled, local contrast and filmic highlights reconstruction practically unusable. Even basic demosaicing may be a pain.

So the major concern is to be able to execute pixel routines with low-level access to GPU and/or powerful CPU.

Then, there is the Gtk toolkit ability. Most GUI widget are not even Gtk, but are custom-drawn through Cairo directly (vector drawing). Noticeably, all the EQ modules are drawn like this. This is also fairly slow to render, in addition of being non standard and not designed for small screens, and re-implementing them is no small task.

Finally, there is zero touch screen support. There is what Gtk supports as a touch-to-click emulation, but many interactions rely on key modifiers (Ctrl, Shift, etc.) and wheel scroll.

1 Like