Skip to content

Conversation

@horazont
Copy link
Contributor

Fujifilm cameras of the X and GF series have support for so-called
Film Simulation Modes. These are said to mimic the look of certain types
of analogue film.

I have wished for the ability to filter on film sim mode for quite a
while. In addition, I would like to, in the future, add specific
dtstyles for the various modes and allow to apply them by default via
apply_camera_style.

This commits provides the foundation for that. It adds the ability to
filter by and view the film mode in the UI. It also exports the film
mode to Lua, so that apply_camera_style could in the future use that.

@horazont
Copy link
Contributor Author

I should note that this commit contains more code layout changes than I'd have liked, but clang-format forced me to :|. I am happy to revert them if you prefer the if-branches which it folded together to be unfolded.

…odes

Fujifilm cameras of the X and GF series have support for so-called
Film Simulation Modes. These are said to mimic the look of certain types
of analogue film.

I have wished for the ability to filter on film sim mode for quite a
while. In addition, I would like to, in the future, add specific
dtstyles for the various modes and allow to apply them by default via
apply_camera_style.

This commits provides the foundation for that. It adds the ability to
filter by and view the film mode in the UI. It also exports the film
mode to Lua, so that apply_camera_style could in the future use that.
@horazont horazont force-pushed the feature/fujifilm-film-modes branch from 49aee0c to 7979be7 Compare October 31, 2025 09:50
@horazont
Copy link
Contributor Author

Advice on how to deal with already imported files welcome. Is there a thing to trigger a re-read of EXIF data after support for a new tag has been added?

@piratenpanda
Copy link
Contributor

piratenpanda commented Oct 31, 2025

In the lighttable view there is a metadata tab under "actions on selection" (i just roughly translated this so it might be named slightly different) there you can click "update exif"

@wpferguson wpferguson added feature: enhancement current features to improve scope: camera support adding WB and raw support for new cameras scope: DAM managing files, collections, archiving, metadata, etc. lua labels Oct 31, 2025
@wpferguson
Copy link
Member

@TurboGit @zisoft @jenshannoschwalm how do we feel about adding camera specific metadata to the image table?

Current Lua scripts use exiftool to extract the metadata.

@horazont have a look at https://github.com/bastibe/Darktable-Film-Simulation-Panel and https://github.com/bastibe/Fujifilm-Auto-Settings-for-Darktable

@zisoft
Copy link
Collaborator

zisoft commented Oct 31, 2025

@horazont: Have you tried adding these tags to the metadata editor? (metadata module --> preferences)
After doing so, the tags can immediately be used as collection filters, image information panel, and can be used as variables as well.

Metadata editor preferences:
Bildschirmfoto 2025-10-31 um 18 24 18

Collection module:

Bildschirmfoto 2025-10-31 um 18 26 10

Image information panel
Bildschirmfoto 2025-10-31 um 18 26 35

@wpferguson
Copy link
Member

@zisoft looks like I need to extend the Lua API a little bit so that it's possible to take advantage of this and rely less on exiftool

@horazont
Copy link
Contributor Author

horazont commented Nov 1, 2025

@zisoft Wow, I was simply unaware of that feature.

I tried it just now on 5.2 and on master (without my patch), and while FilmMode and Color do show up in the panels, neither "refresh EXIF" nor freshly importing an image actually populates those fields (I only get "not defined" in the filter options and "-" in the "image information" panel).

That's probably a bug?

@zisoft
Copy link
Collaborator

zisoft commented Nov 1, 2025

@horazont can you provide a sample image?

@horazont
Copy link
Contributor Author

horazont commented Nov 1, 2025

@zisoft The sample images from raw.pixls.us for X-T4 or X-E5 should do nicely:

X-T4: https://raw.pixls.us/getfile.php/3913/nice/Fujifilm%20-%20X-T4%20-%2014bit%2014bit%20uncompressed%20(3:2).RAF
X-E5: https://raw.pixls.us/getfile.php/8507/nice/Fujifilm%20-%20X-E5%20-%2014bit%20uncompressed%20(3:2).RAF

(the exifdata on raw.pixls.us shows that Exif.Fujifilm.FilmMode is in fact set for both of them)

@horazont
Copy link
Contributor Author

horazont commented Nov 1, 2025

@wpferguson

how do we feel about adding camera specific metadata to the image table?

for what it's worth, I would've thought that the Film Mode field is also useful for other camera brands, even though they might call this feature differently. At least Ricoh seems to have a similar concept (which I learnt by following your links, which I had not been aware of yet, so thanks for that!) and I seem to recall that Canon too has some kind of picture styles (but it's been a while I had a Canon in hand, so I might be misremembering).

@jenshannoschwalm
Copy link
Collaborator

I seem to recall that Canon too has some kind of picture styles (but it's been a while I had a Canon in hand, so I might be misremembering).

I think that some Olys and Leicas have that too.

@horazont
Copy link
Contributor Author

horazont commented Nov 4, 2025

@zisoft Did you have a chance to play with the sample images? I dug around a bit in the code. As far as I can tell, the functions which actually set those metadata items and their callers from within exif.cc are:

  • dt_metadata_set: only on the "apply default metadata" code path
  • dt_metadata_set_import_lock: only called with fixed strings for keys
  • dt_metadata_set_import: only called for Xmp metadata (not EXIF)
  • dt_metadata_set_list: not called at all, though it's not clear if libs/metadata.c:set_params is somehow involved from exif.cc
  • dt_metadata_set_list_id: only used in copy/paste workflows

There's also direct inserts to the data.meta_data table from image.c, but those are only for duplication workflows AFAICT.

From that I conclude that the custom metadata feature only works for Xmp metadata and not for EXIF metadata. Is this plausible or am I missing something here?


As for how I would like to move forward: I don't have strong feelings one way or the other. I can either dig into trying to fix the issue that custom metadata is not imported from EXIF or I can polish this PR here in whichever way necessary if there's consensus that keeping the film_mode in the image table is a good or at least acceptable thing.

Given that there are multiple vendors having a similar feature, I could see some benefit to having a unified tag for this instead of a custom metadata field users have to enable. So I have a slight tendency toward that.

@horazont
Copy link
Contributor Author

horazont commented Nov 4, 2025

Because I might actually want to have this custom metadata feature anyway, I filed #19656 with an incomplete attempt at fixing it. It doesn't fully work yet, see the PR message for details, any suggestions appreciated.

@TurboGit TurboGit added the priority: low core features work as expected, only secondary/optional features don't label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: enhancement current features to improve lua priority: low core features work as expected, only secondary/optional features don't scope: camera support adding WB and raw support for new cameras scope: DAM managing files, collections, archiving, metadata, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants