Recommended way to recreate Fuji Film Emulations?

Hi all,
I have an X-H2 and have submitted sample raw files. The devs have already updated the camera.xml file on the github and I am using it with dt 4.0.1. My question pertains to the recommended way to recreate the Fuji Film profiles the camera applies to JPEGs in dt. My research has uncovered the color lookup table, various sets of dtstyles and not much else. None of it has been updated for dt 4.x and I was wondering if anyone has updated procedures.

1 Like

Will these work? Fuji Film Simulation Profiles – Stuart Sowerby

There is a user that has created a lua script to examine the exiv data and see what profile the jpg was shot in and then apply some styles… I will try to hunt this down… I will edit this post when I do…

Edit
https://bastibe.de/2022-05-04-customizing-darktable-for-fujifilm-cameras.html

2 Likes

Turns out he has some styles and luts that seem to do the job. Took a couple of tries to get dt configured correctly, but i think I have it now.

1 Like

If you’re using my LUTs, be careful with saturated highlights. I used natural photographs for training the LUTs which includes good data for most natural colors. However, if you push saturation beyond natural limits (or use strong colored light sources), you can push beyond the LUTs’ limits.

It’s easy to fix when you see it. It can make saturated highlights look weirdly grainy.

3 Likes

The lua script does not appear to work. When I import photos from my X-H2, I don’t see the lut being applied.

Check the logs. It probably can’t find exiftool, or something about the tag names is different in the X-H2, or something didn’t install correctly.

There should be reasonable error messages in the log.

2 Likes

Very cool. Does this work with DT on Windows as well?

Do you have lua installed and the script manager…you will see it lower left in lighttable view.

Copy the script to the contrib folder in the lua folder of your config directory and it should work to the best of my knowledge…There are also lots of other scripts that can run… this recent one is really cool…

This is what you are looking for to manage and run the scripts…

image

Yes, I have that, but was wondering about this part:

“Install exiftool and make sure it is available on $PATH.”

Not sure what the equivalent path would be for Windows.

Yes, Lua and exiftool are installed.
I ran it in debug mode and it says “Ignoring non-raw file.” which is odd as it is a .RAF file. Yes, I am shooting raw+jpeg, but the jpegs are written to my SD Card and I am only importing raw files from my CF Express card.

OK, the “Ignoring raw file” error is because you are testing for the file to end in .RAF not .raf. On line 182 of the script I changed it from:

if not string.match(image.filename, "%.RAF$") then

to

if not string.match(string.upper(image.filename), "%.RAF$") then

which fixes the issues with case sensitive file systems (like Linux).

Now the real fun begins:

1.535799 LUA [fujifilm_auto_settings] loaded
9.099943 LUA [fujifilm_auto_settings] executing '/usr/bin/vendor_perl/exiftool' -t '/home/guru/Pictures/Photos/2022/2022-11-18/IMG-20221118-0112.raf'
9.162231 LUA ERROR : ....config/darktable/lua/contrib/fujifilm_auto_settings.lua:195: attempt to concatenate a nil value (field 'Development Dynamic Range')
stack traceback:
	[C]: in metamethod 'concat'
	....config/darktable/lua/contrib/fujifilm_auto_settings.lua:195: in function <....config/darktable/lua/contrib/fujifilm_auto_settings.lua:176>
	[C]: in ?
9.188447 LUA [fujifilm_auto_settings] executing '/usr/bin/vendor_perl/exiftool' -t '/home/guru/Pictures/Photos/2022/2022-11-18/IMG-20221118-0114.raf'
9.251956 LUA ERROR : ....config/darktable/lua/contrib/fujifilm_auto_settings.lua:195: attempt to concatenate a nil value (field 'Development Dynamic Range')
stack traceback:
	[C]: in metamethod 'concat'
	....config/darktable/lua/contrib/fujifilm_auto_settings.lua:195: in function <....config/darktable/lua/contrib/fujifilm_auto_settings.lua:176>
	[C]: in ?

For the record, renaming my file to end in .RAF causes the same error.

Apparently in the X-H2/S files (possibly the X-T5 as well) there is no entry in the exif data called “Development Dynamic Range” only “Dynamic Range”. Changing line 195 from “Development Dynamic Range” to “Dynamic Range” fixes the problem.

1 Like

Nice detective work I was going to suggest you do some comparisons from your exif data and what the script was looking for… seems like you are tracking most of it down bit by bit…

38 years of IT experience does that…

On detective work, I have some older Fuji files to test with, but if the X-H2/S is different, we have have to detect for those models and branch the code.

I forgot this chap as well… translates well to english…can’t say about other languages…

1 Like

It might not be the Fuji files. I think the latest version of exiftool is reporting dynamic range as just “Dynamic Range”. Some X-Pro3 files show Dynamic Range as “Standard”.

EDIT: Testing with X-Pro2 files matches what is in the original script. Some additional logic is going to be needed to accommodate earlier models vs. later ones.

1 Like

Thank you for tracking down these issues! I’d very much appreciate a pull request to make it compatible with the X-H2. I was only able to test it with images from my own cameras, which did not include anything more modern than the X-T3.

As for the case sensitive file name, I’m afraid I usually work from an exfat external volume. Sorry about that!

There’s a system setting called “Environment Variables”, which includes PATH. It world just like on Linux.

(But exiftool is markedly slower to start on windows, which makes the procedure somewhat more cumbersome)

Not to worry. I have that fixed and will be part of the pull request. I tested with X-Pro2, X-Pro3, X-H2S, and X-H2 files. Post X-Pro2, the key “Development Dynamic Range” only appears when HDR drive mode is selected and a Manual DR is selected. There is a field called “Dynamic Range Setting” which is either nil, “Auto” or “Manual”. We also need styles for DR800 and DR800+. I still have to debug the “Auto” setting a little more. I have never coded in LUA but it is a fairly simple

1 Like

That’s fantastic, thank you!

I’ll look forward to the pull request. Feel free to message me here or on github if you need any assistance.