Exporting with exact size in pxls

Hi all,
I am exporting for printing with exactly defined size in pixels, for instance 2480x3602 (after setting up right proportions of the photo in the crop&rotate module). However, the output file has slightly different size/proportions - 2480x3600. Why is that? I have allowed upscaling and resampling (even if not needed in this case). Tell me please if I missed something.
Thanks in advance for your feedback.

this can be the same rounding issue I have reported earlier https://github.com/darktable-org/darktable/issues/9738.

Or even simpler: dt tries to stick as close as possible to the aspect ratio of the full-sized image, and considers the dimensions you give as maximum values for the exported image(s).

So you could try adding a few pixels to the shortest size (or removing a few from the longest),

That seems indeed to be the issue of initial proportions. However, it is very hard to find the exact ones. When playing with parameters I end up with different values, like 2377x3602 or 2480x3599. I would like dt to resample/upscale to the right values as these are the expected values by my printing service.

Perhaps the easiest way to get exact proportions is to define the crop and the export size in such a way that you know which dimension will be exact, and ensure that the other dimension is some pixels too large. Then use a program like the GIMP or Imagemagick to crop to exact dimensions (with no scaling whatsoever needed).

Trying to do it only in dt is probably going to be a very frustrating exercise, between the cropping and the rounding needed on export.

Thanks. I was hoping to rely purely on dt :-(.

My workflow would need to be:

  • develop a photo in dt, export it in TIF with a certain reduced size, close to desired proportions
  • load the TIF in GIMP and fine tune the crop
  • load the finally cropped image back in dt and sharpen it for a print and export as JPG

I will have to give it a try.

Why not sharpen in the GIMP at the final size? It is a capable program.
Though I wouldn’t use it for most of my editing (dt being more flexible and designed for photography) small corrections like sharpening are easy enough to apply, and it avoids another switch.

You can do points 2 and 3 using imagemagick from the command line, and script it to do it in all images at once

1 Like