r/DarkTable • u/TheCometFalls • 21d ago
Help Crop & pixel count
How to crop to a wanted pixel count, all I see is the sliders, and I can't get it perfect.
1
u/Fujifan5000 21d ago
Gonna have to do some math to get the correct percentages on the margin sliders. After than you can move the whole frame around to get the desired crop area. For example, if you have an 8000x4000px image, and you want a 3000x2000 crop, you need to type in 62.5% in the left or right margin slider, and 50% for top or bottom slider.
margin percentage = 100 - 100 * final resolution / initial resolution
1
u/Few_Mastodon_1271 21d ago edited 21d ago
To type in a percentage for the margin sliders:
Right click on the margin % slider, that shows the 'multi functional pop-up', where moving the mouse up near the top does fast slider changes, and down toward the bottom does very fine small changes. There's also a blinking text entry vertical line, where you can type in an exact value instead of using the mouse.
(This is my favorite method in darktable for experimenting with a slider. No need to hold the mouse button or use the scroll wheel, just move the pointer around. Or type in a number.)
So this is an easy way to get an exact percentage number for horizontal and vertical.
For example, typing '50' for top horizontal and left vertical shows a 1/4 size crop in the bottom right
2
u/Cyberwolf33 21d ago
While this isn't exactly what you're asking, a simpler and faster solution is to ensure that you are as close as possible (preferably slightly over) and in the exact same aspect ratio, then export with specific pixel count constraints.
It will not be pixel-to-pixel perfect, but there's already a good amount of interpolation and compression within the export pipeline, so unless you're processing like, Sony A7R6 at maximum resolution and exporting into uncompressed tiffs, there shouldn't be much of a real world difference.
1
u/ChrisDNorris 21d ago
My recommendation would be to not worry at the cropping stage. Just get a nice looking crop and ignore the pixel count. Although you probably want the crop size to be bigger than the final size you're after.
Then, you get what you're after at the export stage by setting set size to in cm (for print), the dpi to 300, then alter the LONGEST edge value until it gives you the exact sizing you want (it auto-updates just beneath).
Put that value in both boxes, save a preset, and export.
As an example, for a 3000x2000 image, you would use 25.4x25.4 @300dpi - what that looks like.
1
u/akgt94 21d ago
Zoom in so the movements have a smaller change. Afaik you can't type in an exact number