darktable-cli questions

$ darktable-cli /daten/fotos/quelle/test /daten/fotos/rendered/darktable_output/
notice: output location is a directory. assuming '/daten/fotos/rendered/darktable_output//$(FILE_NAME).jpg' output pattern
no images to export, aborting

doesn’t help without slash

Im on holiday with only my cellphone. I can’t help anymore without trying it once I get back home.

What happens if you place a raw file in the input folder?

1 Like
dpkg -l | grep -i darktable
ii  darktable                                      5.2.0-1.1+87.1                             amd64        virtual lighttable and darkroom for photographers
$ ls -1 /daten/fotos/quelle/test/
test.dng
test.dng.xmp
$ darktable-cli /daten/fotos/quelle/test /daten/fotos/rendered/darktable_output
notice: output location is a directory. assuming '/daten/fotos/rendered/darktable_output/$(FILE_NAME).jpg' output pattern
no images to export, aborting

Export with the GUI works, but it creates a very large file. DNG-Photo is from a cellphone.

$ identify /daten/fotos/rendered/test.jpg 
/daten/fotos/rendered/test.jpg JPEG 4496x6000 4496x6000+0+0 8-bit sRGB 44.7802MiB 0.000u 0:00.002

45MB for a jpg with 98%, the DNG is 52MB. I can’t believe that the original has such a high quality, that the output is so big.

The jpg-file (simultanous) created by the phone is 11MB.

Thanks for helping me during vacation.

We have a ton of PlayRaws. Why don’t you try with one of those first. Cellphone dng can have demosaic data.

I have tons of RAWs of DSLR too. I don’t understand why a file should not work with cli, while it works with GUI.

$ ls -1 /daten/fotos/quelle/test
test.pef
test.pef.xmp

test.pef was opened with 5.2 and modified a little bit.

$ darktable-cli /daten/fotos/quelle/test /daten/fotos/rendered/darktable_output
notice: output location is a directory. assuming '/daten/fotos/rendered/darktable_output/$(FILE_NAME).jpg' output pattern
no images to export, aborting

To be sure, I purged the test files before I copied other files with the name test to the directory

purge_non_existing_images.sh --purge
Removing the following non existent file(s):

If you’re trying to export multiple files in a folder, I usually use a loop in bash instead, more flexible.

For example, this would list all RAF files, then call darktable-cli on each, output to “exported” folder and append .jpg to the filename. You can try running this, it just prints out the darktable-cli command for you to tweak, once you think it’s good, just remove the echo and it will actually call darktable-cli.

The ${f%.*} basically extracts the filename without extension (from the RAF file).

ls *.RAF | while read f; do echo darktable-cli "$f" "exported/${f%.*}.jpg"; done

In my folder, the above command will print this (if you remove echo, it will execute these instead)

darktable-cli DSCF5438.RAF exported/DSCF5438.jpg
darktable-cli DSCF5439.RAF exported/DSCF5439.jpg
darktable-cli DSCF5440.RAF exported/DSCF5440.jpg
darktable-cli DSCF5441.RAF exported/DSCF5441.jpg

BTW, I don’t think --core quality 90 works, you need to specify the plugin with --core --conf plugins/imageio/format/jpg/quality=90 (I think I found out while trying to set TIFF format to 32-bit for my script with --core --conf plugins/imageio/format/tiff/bpp=32)

1 Like

Then again, quality 98% is ridiculously high for a jpg as final output. Usual advice iirc is to use 90 maximum. If you need still better quality, perhaps a lossless format is more useful? (Tiff or png come to mind, with compression, of course).

Comparing with the DNG is a bit risky: if that is a raw file, it has less data/pixel than a jpg: raw is usually 12-14 bit/pixel, an image file starts with at least 24 bits/pixel, so about twice as much as the raw. So that 52MB raw would correspond to an uncompressed image of 90-100 MB…

Check the image size to be sure the comparison is valid, and most likely that jpg is not saved at the equivalent of 98% quality (80% or so? perhaps even less)

1 Like

wait, I think the math is a bit off here.

JPG has 256 (2^8) values, or 8-bit, per color. Each pixel has 3 colors (RGB), so that is 24-bit/pixel.

RAW usually has 14-bit per color, thus, 14*3 = 42-bit/pixel. That’s why RAW has a lot more dynamic range than JPG.

Or, am I just too sleepy and have it all wrong?

But raw has only one colour per pixel, the other colours are added during demosaicing (through interpolation).

2 Likes

My bad, I saw DNG and thought about already demosaiced data … been working on passing demosaiced TIFF32 between darktable and nind-denoise too much … should get some sleep :sleepy:

98 is my standard quality, because the dt output is base for other size conversions, cropping, a.s.o including or deleting metadata.

Till now, I didn’t care about size. I was with my DSLR in the range 7-15MB, but about 50MB is far away from acceptable.

Please note, I am testing with cellphone DNG, because I want to know what is possible, if no DSLR is available.

The image size is nearly the same. At the end the phone has a bigger size / area, because the sensor is 4:3

Maybe the dng-cellphone-file is not (perfect) useable with dt?

Here are samples:
1 dng-file and 1 jpg-file from the cellphone, taken at the same time automatically

https://drive.google.com/drive/folders/1QYxw90o1rz0JgalqvCMwvsbFzTwWR6Ck

Simply export the dng without editing and check the size. I used my standard-presets, but this shouldn’t matter for size.