darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.08k stars 1.1k forks source link

Adding additional options to lighttable to aid with planning social media posts #15471

Open ungive opened 8 months ago

ungive commented 8 months ago

Is your feature request related to a problem? Please describe.

I share some of my photos on social media, as perhaps quite a few other users do, and I like planning in advance, to get a grasp of how my posts will look in the standard 3-wide grid on e.g. Instagram. I'm quite a perfectionist about that (more than I'd like to be) and I can't really live without having some kind of preview before committing to actually posting. It also gives me peace of mind.

That being said, I love Darktable and I do almost everything in it. Getting a preview like the following has always been kind of a hassle though because I needed to hack it together with GIMP or by exporting my photos first, reimporting them and then applying a square crop:

grafik grafik

Additionally, in general, I have never liked that the zoomable lighttable layout has a fixed column count of 13 images, it would be nice to have a second slider to control that. This would be a good addition imo, even outside the context of my specific social media use case.

Also, in the zoomable light table layout, I have noticed you cannot drag images around to reorder them when using a custom sort. There also does not seem to be an option to scroll normally, scrolling always seems to cause the zoom to change, but I would like to scroll up and down normally as well, since I prefer that to dragging with my mouse.

Describe the solution you'd like

I have four suggestions to improve Darktable in this regard:

  1. Add a button to the global toolbox at the top right, e.g. next to the grouping button, to enable "square thumbnails" while being in the lighttable view. While this button is active, all thumbnails in the lighttable view will be cropped to the center square, just like social media platforms do it. Generally speaking, the images are zoomed in until they fill the thumbnail square in their entirety. This is useful to get a preview of what your photo would look like on social media, and in general, it might be useful to "see more" of your photo if you have small thumbnails, cause it kind of gives a temporary, non-destructive zoom effect. "Non-destructive" is important here, as it's only a change in rendering, not a change of the image itself or the edits in its XMP. Thinking further, one could also hide the overlays and change them to "overlays on mouseover", for the time square thumbnails are active.
  2. Add a second slider while being in the zoomable lighttable layout, to control how many columns the layout has, so that we aren't fixated on exactly 13 columns. This would help me with looking at my photos in a 3-column layout, while still being able to zoom out. Using 3 columns in the file manager layout zooms in too much.
  3. Allowing dragging and reordering of photos in the zoomable lighttable view with a modifier key and dragging, e.g. ctrl+click, while using a custom sort.
  4. Allowing scrolling in the zoomable lighttable view with a modifier key, e.g. ctrl+scroll, as an alternative to zooming in and out with the scroll wheel alone.

Alternatives

Possible alternatives for each suggested feature/enhancement:

  1. Creating square previews/thumbnails in another way: a. Exporting all photos, manually hacking something together in GIMP or the like. Very annoying and not a solution to me. b. Exporting all photos and writing some external software which e.g. generates a web page with the kind of preview I want. Also not very practical, especially for people who don't hack scripts together in their free time (most users of Darktable). c. Exporting all photos (with e.g. a white frame, as it's often necessary on social media), reimporting them to Darktable, then adding a square crop. One of the more practical solutions, but it requires an export and reimport, whenever there is a new image or an image changes. So that's not that practical (but it works). d. Trying to do it within Darktable like this: Changing the crop module and framing module settings in such a way, that the image looks like it was cropped to a center square. This is a destructive operation though, as the originally intended crop and frame is replaced with something else. Not practical for me. Unfortunately, to my eye, it does not seem to be possible to apply a second crop on top of all edits (including the frame), to get the desired effect (the crop module cannot be cloned). Reordering the crop module on top of the frame also doesn't give an export ratio as it is defined in the crop module itself.
  2. No real alternative for this, other than modifying Darktable's source.
  3. Switching to the file manager layout, reordering, then going back to zoomable layout. Not really a valid alternative, as I want to reorder them in the 3-column layout, not any other, so I'd have to switch to 3 columns in the file manager layout, which zooms in way too much. I might as well not use the zoomable lighttable layout at all then.
  4. Just dragging with the mouse.

Additional context

If you look closely at the screenshot above, you can see that this is a screenshot of Darktable. I have already fully implemented solution 1 and I experimentally changed line 413 in src/dtgtk/thumbtable.c to table->thumbs_per_row = 3;, to get a grasp of how helpful this would be to me (and what a relief to get square previews with a single mouse click). I love it so far! For reference, this is what the original images look like, without enabling square thumbnails:

grafik grafik

I would really like to see this be improved and I would offer to fully implement this myself. I've already done the first part, which you could try or look at in the lighttable-square-previews branch of my fork here: Link to relevant commit. Quick note on using gtk_widget_queue_draw: I tried re-rendering the lighttable thumbnails with thumbnail->img_surf_dirty = TRUE; and dt_thumbtable_full_redraw(thumbtable, TRUE);, but that didn't redraw the thubnails immediately, only when hovering over one of them.

Before committing to it further, I wanted to open this issue, to get people's opinions on this, as I do realise it's kind of a niche use case not fully related to improving the photo editing experience that Darktable is targeted at. Still, I think it would be useful, and at least in my case, I would absolutely pull the source code, apply my changes, and compile Darktable myself every time there is a new Darktable release to get this feature, in case it never makes it to the master branch.

I also realise, since it's a niche feature, the button in the global toolbox could cause unnecessary clutter (I realise the UI should be kept as minimal and concise as possible). My suggestion would be to e.g. add a setting to hide the button (by default?) or make this a shortcut-only feature without any UI element. These are just suggestions though.

Thanks for reading! I'm curious about your opinions on this.

wpferguson commented 8 months ago

Why not use file manager layout and just set it to 3?

squarelayout

ungive commented 8 months ago

In that case I always have to either make my darktable window less wide or decrease the width of the lighttable by increasing the width of one of the panes on the left/right, so that I can see more than just one or two rows. Also, it's just not this large on social media, especially when viewing on the phone, so an accurately sized preview on a large desktop display is a necessity. Photos are perceived differently, depending on how large they are, so it's helpful to be able to zoom out. For that reason I also occasionally look at the small preview on the top left in the darkroom when editing, cause some photos look great when they are large and you can enjoy the details, but when they're small they might not be that appealing at all, or some flaws become very apparent. And that plays a big role to me when looking at the 3-column grid which only has small thumbnails. Resizing my window or in-window panes all the time seems hacky to me.

I hope that gives some insight into my thinking!

wpferguson commented 8 months ago

To get square thumbnails without editing each image, create a style that applies a square crop. Create another style that turns it off.

Select your images then apply the square crop. Now you have square thumbnails.

When you're done, select the images you want to "uncrop" and apply the style to turn the crop off. Now you have the previous aspect ratio.

ungive commented 8 months ago

To get square thumbnails without editing each image, create a style that applies a square crop. Create another style that turns it off.

This only works if the images do not already use the crop module, as there cannot be multiple instances of it ("new instance" and "duplicate instance" is greyed out). Even if an image doesn't use a crop yet, when using the framing module, the crop comes before framing in the pipeline, and the aspect ratio of the frame is what dictates what the thumbnail/export will look like. I attempted to reorder it so crop comes after framing, but that doesn't give the desired aspect ratio either (try it). Anyway, at that point we're looking at completely obliterating the XMP edits, which, to me, is undesirable.

AlicVB commented 8 months ago

tbh, for such "niche case" (as you say) I would go with a lua script and imagemagick (or whatever other tool)... See for example : https://legacy.imagemagick.org/Usage/montage/

AlicVB commented 8 months ago

That said, I think your request about the ability to change the number of images per row in zoomable mode would be a nice enhancement

ungive commented 8 months ago

tbh, for such "niche case" (as you say) I would go with a lua script and imagemagick (or whatever other tool)...

I absolutely hear you. Personally, I'd like to stay in Darktable, instead of switching back and forth between it and a script, while perhaps having to export the images in question every time. I haven't experimented with the Lua scripting that Darktable offers yet though, so there might be a convenient solution hidden somewhere. I'll look into it, thank you!

About this niche case in general, I think it would be helpful to know what percentage of the users would actually appreciate something like this or who have a similar issue. Maybe posting it on the forums would be a good idea to get opinions.

wpferguson commented 8 months ago

It sounds like what you want is a layout and preview tool for instagram. Perhaps scrbus would work?

The lua scripts can automate and extend darktable. They can also be an interface to an external program, such as gimp. There is a script, contrib/gimp.lua, that exports an image to gimp, then retrieves the edited result, imports it and groups it with the original.

ungive commented 8 months ago

Thank you for your comments!

For my "social media use case", implementing something into my workflow that involves exporting and transfering between applications is way too overkill and inefficient, when I already manage and look at all my photos directly in Darktable and the only problem is that lighttable lacks a rendering option to crop the thumbnail to its center square. Imo, such a simple and unobtrusive switch beats any other solution I can think of and couples immensely well with the plethora of options lighttable already offers to arrange and look at photos. Why reinvent all of that with a script or by using GIMP or another software, if it can be this easy?

The implementation of this is also trivial (unless I missed something crucial which I wasn't aware of).

Plus, I think every user of Darktable who posts on social media and would like some kind of preview of the cropped center square would appreciate such a feature!

wpferguson commented 8 months ago

darktable is a raw developer. Instagram layout and preview have nothing to do with raw development. Instagram layout and preview take the output of the raw developer and use that as an input.

If we start making darktable a raw developer and an Instagram layout and preview tool, and a page layout tool, and a ... then it's going to be a mess. Do one thing and do it well.

On the same note, if we start adding buttons, widgets, and modules to the UI to accommodate everyone's specific workflow, then there won't be any room for thumbnails :).

wpferguson commented 8 months ago

I thought some more on this....

My objection is making a user specific workflow part of core darktable is that everyone has it present whether they want it or not. Also, it has to be maintained, and since it's a user specific workflow it may change based on the user or the platform. We got rid of exporting to social media platforms because we couldn't keep up with the API changes.

So the question is "how do we implement user specific workflows" in darktable. The answer is using the Lua scripts. That's how my user specific workflows are implemented as well as those of many others.

In addition to what I mentioned above, you can do the following from the lua-scripts API:

So what we need to do is make sure that the functions/hooks needed are available to the lua-scripts API.

That said, I think your request about the ability to change the number of images per row in zoomable mode would be a nice enhancement

This would need to be implemented.

Next is square thumbnails.

If this is a set of styles, then it could be done from a lua-script. I know the argument against cropping twice, but I'm confused about why you would crop to anything other than square if Instagram is your target. I have a picture of a basketball player dunking. If I crop it to the center square I have a picture of a basketball player from knees to elbows :). If I had to crop square then I would use the upper half of the picture.

Another option is to make duplicates and apply the crop as the last step of editing. Color label the duplicates, then restrict the lighttable to them, and do the layout and preview. You could actually script the duplicate creation, apply a crop style based on aspect ratio, apply a color label, set the lighttable mode, then filter by color label.

The final option would be adding code to master. It might be done with an overlay mode, otherwise it would be a thumbtable change.

AlicVB commented 8 months ago

That said, I think your request about the ability to change the number of images per row in zoomable mode would be a nice enhancement

This would need to be implemented.

Of course... another point on my TODO ;) Contrary to the other points and especially the "square" thumbnails, I don't see this as workflow specific, but more as something that might profit to everyone (using zoomable of course). I don't think it'll be very hard to implement... but you know the gap between theory and reality ;)

AlicVB commented 8 months ago

The final option would be adding code to master. It might be done with an overlay mode, otherwise it would be a thumbtable change.

this is the key point I think. I'm quite sure it's beyond lua capacity... and adding code like that in a "generic" way (read : not specially for the 3x3 of instagram, but for other arrangement too...) will be really hard and will require quite some code and maintenance...

github-actions[bot] commented 6 months ago

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.