This module has been derived from the spektrafilm code and tries to stay as close or exact to the algorithms used there.
Currently the module looks like this:
Film and print stocks can easily be selected via drop downs. Further settings are then handled inside the respective tabs (currently untranslated).
Default settings are Portra 400 and Portra Endura which transform your image from
to
Currently almost every film/paper combination from the spektrafilm dev branch is working except for Kodak 2302. Grain, Halation and Diffusion models are working as well.
Needs this python script to run with an official spektrafilm installation (currently dev branch only) before: spektrafilm_export_data.py (10.8 KB)
# install dev branch in a venv
python -m venv ~/venv-spektrafilm-dev
~/venv-spektrafilm-dev/bin/pip install git+https://github.com/andreavolpato/spektrafilm@dev
# then run the python script
~/venv-spektrafilm-dev/bin/python spektrafilm_export_data.py -o ~/.config/darktable/spektrafilm
I’m using it on Arch Linux and don’t know if Windows needs something specific but it shouldnt. In my PKGFILE I do (depending on where the patch lives of course):
I hope to have tested it enough so there shouldn’t be any obvious differences but of course I could have missed a few spots. The most obvious one is that this has per film grain as the original version does whereas the LUT module had a fixed amount of grain.
I love having this module available at the same time I feel bad for not understanding every single line of code there is. But as it’s just a play thing I guess that’s fine.
While I am opposed to LLMs for writing new things, particularly when the user isn’t even a programmer and understands what is being generated, for translating code from one software or language to another it’s a different thing in my opinion. This idea was well executed in the AgX module, for example, and as we can see from Kofa’s further work on darktable, a net positive overall.
Translating from one software to another also enables running tests to compare and validate that the output is the same across code bases.
Thanks for providing this - really looking forward to see how this works in darktable.
I get the following error when running the export data script.
File "/Users/myuser/GitHub/spektrafilm/spektrafilm_export_data.py", line 40, in _grain_export
"rms_granularity": _widen3(gr.rms_granularity),
^^^^^^^^^^^^^^^^^^
AttributeError: 'GrainParams' object has no attribute 'rms_granularity'
Commenting out the offending line, the scripts runs just fine and creates the data:
wrote /Users/myuser/.config/darktable/spektrafilm/pack.json (spektrafilm 0.3.4)
wrote /Users/myuser/.config/darktable/spektrafilm/spectra_lut.f32 shape (192, 192, 81)
copied 28 profiles (0 B&W widened to 3 channels)
I guess something is missing now, related to grain simulation, right? Anything else wrong (“0 B&W …”)?
For bw you need to run the Spektrafilm dev branch. I guess for all of it to work properly. Will provide more details on about what I did on my box tomorrow
# install dev branch in a venv
python -m venv ~/venv-spektrafilm-dev
~/venv-spektrafilm-dev/bin/pip install git+https://github.com/andreavolpato/spektrafilm@dev
# then run the python script
~/venv-spektrafilm-dev/bin/python spektrafilm_export_data.py -o ~/.config/darktable/spektrafilm
Thank you for this. Both the original spektrafilm and this module seem to require jumping through too many hoops for me to be comfortable trying them (what on earth does “baking luts” mean ) but if the spektrafilm process ever makes it into stable dakrtable that would be spektracular (sorry for the pun, could help myself).
Thanks again for this, great work - it was straightforward to integrate on macOS and now I’m playing with it
One remark: in the reference python/napari implementation from Andrea the “film exposure” is by default automatically compensated for by print exposure going in the opposite direction. Apparently same here, so “film exposure” has no brightness effect except for positive films.
In Andrea’s implementation, that “print auto compensation” can be turned off, but that flag is not exposed in the darktable gui - it might make sense to either turn it off by default or to expose it too.