darktable icon indicating copy to clipboard operation
darktable copied to clipboard

Centering crop when selecting a preset

Open gerritsangel opened this issue 9 months ago • 12 comments

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

When enabling a crop preset which is narrower than the original image (e.g. 1:1 crop on a 3:2 image), the crop is automatically applied at the right edge.

Describe the solution you'd like

The crop should be applied at the center of the image. This is what the cameras also do, when enabling e.g. a 1:1 crop in the camera.

Alternatives Of course it's possible to just move the crop manually to the center, but it's one additional step. It is also possible to create a general preset which crops in the middle.

Additional context

gerritsangel avatar Mar 05 '25 18:03 gerritsangel

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.

github-actions[bot] avatar May 05 '25 00:05 github-actions[bot]

Move the crop box to the desired position and then create a preset; use that instead of selecting the aspect ratio from the pulldown menu. The module has parameters for percentage to crop off of each edge, so you can also have a crop which uses neither the full height nor the full width. I've made myself such presets for several aspect ratios, as well as a "digital zoom" preset which crops to the center 50% in each dimension.

Unfortunately, centered cropping presets with aspect ratios other than "freehand" will only work correctly for a particular aspect ratio as input due to the margins being defined as a percentage of the input size and the module then forcing the selected output aspect ratio. The behavior you see from the aspect-ratio pulldown menu is a result of that forcing with the default margins of 0 on every edge.

ralfbrown avatar May 20 '25 09:05 ralfbrown

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.

github-actions[bot] avatar Jul 20 '25 00:07 github-actions[bot]

Thanks for your reply and sorry for my late one.

Hmm yes, I made some workarounds/presets on my own. Mostly I was creating this issue in order to have a more camera like "default", also for new users. Just to make the learning curve a bit easier.

So from I undestand your reply, this is basically a limitation of the current crop implementation, not necessarily a design choice or? I guess it should be possbile to calculate a centered crop window when activating the module (using the dimensions of the image and then just calculating left and right or top/bottom percentages).

gerritsangel avatar Nov 19 '25 20:11 gerritsangel

@gerritsangel

I've made myself such presets for several aspect ratios, as well as a "digital zoom" preset which crops to the center 50% in each dimension.

For a "digital zoom" type of crop, one method is to use the lens correction module and increase its "scale" value. This is a restrictive type of "crop" since the aspect ratio and center of image will be unchanged.

flux77 avatar Dec 05 '25 21:12 flux77

@flux77. Thanks! Would it make sense to "improve" the default in the crop module? I learned here that there are a lot of workarounds and multiple ways for crop available. As a new user, centering a different aspect ratio crop would be consistent with what the cameras are doing, though. I think it would be definitely easier to start, than first having to create a preset.

A specific "digital zoom" crop is also nice. As a sidenote, I guess the crop module could in this case even display the output megapixel to have a quick idea about the new effective resolution. And even more interestingly, calculate the equivalent cropped focal range (Similar as the 35mm equivalent focal range on crop sensor bodies).

gerritsangel avatar Dec 06 '25 04:12 gerritsangel

@gerritsangel

As a new user, centering a different aspect ratio crop would be consistent with what the cameras are doing, though. I think it would be definitely easier to start, than first having to create a preset.

A specific "digital zoom" crop is also nice. As a sidenote, I guess the crop module could in this case even display the output megapixel to have a quick idea about the new effective resolution. And even more interestingly, calculate the equivalent cropped focal range (Similar as the 35mm equivalent focal range on crop sensor bodies).

I believe all these features could be implemented using Lua scripting, but I haven't yet tried out darktable's Lua API.

flux77 avatar Dec 07 '25 17:12 flux77

Would it make sense to "improve" the default in the crop module

Does it make sense to "break" the default in the crop module for ALL the current users?

I would say add an option (preset) for centered crop and that way those that want it could have it and those that don't wont have it inflicted on them (in this case me because I do lot's of cropping and I NEVER use a centered crop).

EDIT: I just commented on another issue that wanted something to be simple and easy (at the expense of flexible and powerful)).

darktable gives you flexibility and power at the expense of ease of use (for some) and a learning curve. I'm not against making darktable easier to use, but I don't think it should come at the expense of current users or flexibility and power.


@flux77 the lua documentation is at https://docs.darktable.org/lua/stable (or development if you want the changes affecting current master). The scripts themselves are the best example of how to do things, but if you have questions feel free to ask me.

wpferguson avatar Dec 07 '25 17:12 wpferguson

Hello,

Thanks for all your replies. I understand that there are workarounds, that there is Lua scripting etc.

For me the whole reason of creating this issue here was to improve the user experience for all (also especially for new users).

Lua scripting is of done for developers. I can do it, yes, but "normal" users not (I used to be a normal user, so at that point, doing any proper scripting was not really possible for me). The digital cameras which I tested all do a center crop in camera. I thought, aligning on what the cameras are doing is first a good thing, because almost every user of Darktable will have used a digital camera to take the photo. So why not do what the cameras are doing, if it's not completely weird?

I know of course, that changing existing things is hard, because existing users have something to lose/change, and new users are not using the application (yet).

Therefore I'm not really sure how to handle this topic here. For me, it was just quite cumbersome to always recenter the crop. I thought it might be a small but easy solution. These small details are of course not life-changing on their own, there is always a workaround etc, but small (imho) cumbersome things just add up in general UX.

Does it make sense to "break" the default in the crop module for ALL the current users?

Here I would always argue: What about new users who are not using Darktable because of this and this and this? Maybe there are x current users, but there could be 10 times more new users. I am not arguing that this current design is a blocker for new users to use application.

I would say add an option (preset) for centered crop and that way those that want it could have it and those that don't wont have it inflicted on them (in this case me because I do lot's of cropping and I NEVER use a centered crop).

Imho adding options to make everything happy will make UIs more cluttered and then in the end make everybody unhappier. Especially for in the end small features.

darktable gives you flexibility and power at the expense of ease of use (for some) and a learning curve. I'm not against making darktable easier to use, but I don't think it should come at the expense of current users or flexibility and power.

But isn't that a typical issue of survivorship bias? If you only concentrate on making the software easy to use for people who are using the application, you are not taking all the users into consideration who have stopped using the application directly in the beginning because of that and that reason.

I mean, I of course know how this looks:

  • New person comes to Github, opens issue
  • Wants change of feature because he personally doesn't like it

For me, it's just that while I am now more heavily using Darktable, I can appreciate many of the features which at the beginning just looked complicated. So I am not against a learning curve. But there are still many features/design decisions where I just think: They could benefit from a second look over them. Often it's also just small things, where you are constantly having to press 3 buttons instead of one as in other applications.

Professionally, this is like when somebody new enters a team and notices weird quarks in a software development project. Then he/she (gladly!) speaks up and asks "Why is this done like this?"

It's also not that I am just requesting change. I am happy to dive into the source code and try to change it on my own (no guarantees, but then so be it).

I also don't want to now complain that this specific feature was declined. All good. I'm mostly just wondering on how to contribute :)

gerritsangel avatar Dec 12 '25 11:12 gerritsangel

Here I would always argue: What about new users

If darktable was a commercial application, then this argument makes sense. But, it's not. If we want to attract new users then let's make it look and work like lightroom.

Part of the problem is the definition of "new" user. Is it:

  • never used a raw developer and has no idea how to develop a raw?
  • never used a raw developer but can develop a raw (with GIMP, etc...)?
  • has used a raw developer, but has never used darktable?

Each of the above has a different viewpoint and set of requirements. The first 2 are a lot easier to deal with than the last 😁

only concentrate on making the software easy to use for people who are using the application

We don't try and make the software easier for current users, we try and make it better. Sometimes better is easier and then it's a win/win.

We also try not to make it harder to use, so that what was once the default now requires opening a menu and selecting an item or assigning a shortcut and then having to use it.

The digital cameras which I tested all do a center crop in camera

Which cameras support that, other than a phone? And that's not really cropping as much as zooming.


Professionally, this is like when somebody new enters a team and notices weird quarks in a software development project. Then he/she (gladly!) speaks up and asks "Why is this done like this?"

And then somebody with experience explains the reasoning, or you sit, watch, learn, dig, etc until maybe the light comes on, or you figure out this was a bad idea and code up a change. I've been that guy, professionally and with darktable.

wpferguson avatar Dec 12 '25 17:12 wpferguson

Which cameras support that, other than a phone? And that's not really cropping as much as zooming.

Queue Twilight Zone theme. I just looked in my news headlines and there was an article from Digital Camera World about using crop mode on Canon full frame cameras. 🤦

wpferguson avatar Dec 12 '25 18:12 wpferguson

If darktable was a commercial application, then this argument makes sense. But, it's not. If we want to attract new users then let's make it look and work like lightroom.

I guess that discussion here a lot already. I don't say Darktable should be like Lightroom. I don't say Darktable should be the number 1 used application in the “market”. It has its user base, and fine. But I still think, it's good to be open to new users, because it brings new ideas, possibly even new developers etc. Just take a look at e.g. Blender.

Part of the problem is the definition of "new" user. Is it:

* never used a raw developer and has no idea how to develop a raw?

* never used a raw developer but can develop a raw (with GIMP, etc...)?

* has used a raw developer, but has never used darktable?

I am on purpose here not mentioning the raw development. My impression is: This is not even a problem, because it is probably really interesting topic for software developers: Trying fun things with mathematics and image processing. Who doesn't want to do that?

I am trying to focus a bit more on (in my opinion) low hanging UX/UI topics, which ... well just came to my mind when using the software. For example, except from superficially a long time ago, I have not used Lightroom, nor Photoshop. I have used a bit Affinity Photo. Gimp also. I came to Darktable first because I wanted some way to organize my images, but then also went a bit into the Darkroom mode. Yes, maybe the individual modules could be a bit slimmed down, but in the end, they make somewhat sense if you know the theory behind it. That is all okay and good. I think it's good that there is this kind of application available.

But if I would only want to use the raw processing, I guess i could just use libraw and imagemagick etc. But photography is a creative process, so you need to play around (well, i'm not saying anything new here :D)

That is why i'm trying to focus on UI topics, just because I think they just might have been a bit ... well neglected. I also though it's probably an easy way for me to get started, because - well let's say the developer experience with C and GTK development is not as straightforward as with other ecosystems, especially not on Windows.

Which cameras support that, other than a phone? And that's not really cropping as much as zooming.

What is the difference between cropping and zooming? You select a part of the image. Zooming is just having the same aspect ratio, but what is the difference?

I have access to:

  • Canon M200: Can select aspect ratio of 3:2 (full sensor), 4:3, 16:9, 1:1. Only applies to jpgs. It appends either black bars at the left and right (in 4:3 and 1:1 mode), or at the top (in 16:9 mode).
  • Sony A7IV: Same thing with the aspect ratio, but additionally also APS-C mode which only reads out the inner part of the sensor.
  • Canon R8: Ditto
  • The A7IV in addition (unfortunately not when it shoots Raw) also has a "digital" zoom function, which just crops in center ("zoom").

And what's the problem with that? When you want to shoot square ratio, doesn't it make sense to directly do that with a camera preview? I mean, that's what mirrorless cameras are good at. In the past, you could buy a medium format camera. I don't think there are medium format cameras with this aspect ratio available.

And zooming is also fine if my lens is good enough. Why do I need to carry around a telephoto lens if I can just crop e.g. by 1.5 and still get a good enough image? I can of course do it afterwards post processing (that's why I started the whole topic here), but i might have forgotten how I envisioned the image while shooting.

Queue Twilight Zone theme. I just looked in my news headlines and there was an article from Digital Camera World about using crop mode on Canon full frame cameras. 🤦

But why the facepalm? I think all mirrorless full frame cameras can do that. When you upgrade from APS-C to full frame, you can continue using your APS-C lenses without having vignetting. The resolution of my A7IV in crop mode is better than with my EOS 1100D back in the days (where I could still shoot good images with). Or you like to have a smaller lens sometimes, etc.

And then somebody with experience explains the reasoning, or you sit, watch, learn, dig, etc until maybe the light comes on, or you figure out this was a bad idea and code up a change. I've been that guy, professionally and with darktable.

Yes, or: "We didn't really think about it. It was not so important. Feel free to change."

But I think i'll close the topic here. Hopefully I have more luck with the other aspect ratio topic (https://github.com/darktable-org/darktable/issues/19783) 😊

gerritsangel avatar Dec 12 '25 20:12 gerritsangel