Analog film simulation file format

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
wasd
Posts: 319
Joined: Tue Apr 24, 2018 7:20 pm

Analog film simulation file format

Post by wasd »

What is the format of a file for analog film simulation preset?
CPU Bidir + Metropolis | Core i5-4570
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Analog film simulation file format

Post by Sharlybg »

Seem to be .crf

But we talk to support 3d LUT file format like .cube
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
wasd
Posts: 319
Joined: Tue Apr 24, 2018 7:20 pm

Re: Analog film simulation file format

Post by wasd »

Sharlybg wrote: Tue May 21, 2019 8:47 am Seem to be .crf

But we talk to support 3d LUT file format like .cube
May I ask, .crf is what? I've asked google and received very confusing result.
CPU Bidir + Metropolis | Core i5-4570
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Analog film simulation file format

Post by Dade »

wasd wrote: Tue May 21, 2019 9:07 am May I ask, .crf is what? I've asked google and received very confusing result.
There is a list of predefined camera responses (https://github.com/LuxCoreRender/LuxCor ... e.cpp#L429) and you need to use the name as file name (i.e. the name will be recognized and a corresponding internal pre-defined LUT will be used).

Otherwise you can write a .crf file: it is a text file with a table to translate each RGB color from a value to another (I have to check the parsing code if you need the exact format).
Support LuxCoreRender project with salts and bounties
wasd
Posts: 319
Joined: Tue Apr 24, 2018 7:20 pm

Re: Analog film simulation file format

Post by wasd »

Dade wrote: Tue May 21, 2019 10:28 am Otherwise you can write a .crf file: it is a text file with a table to translate each RGB color from a value to another (I have to check the parsing code if you need the exact format).
I would like to know the exact format to make my own presets, if it's not too much trouble.
CPU Bidir + Metropolis | Core i5-4570
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Analog film simulation file format

Post by Dade »

A database of 201 response curves can be downloaded from http://www.cs.columbia.edu/CAVE//softwa ... b/dorf.php (the direct link to the file is http://www.cs.columbia.edu/CAVE//softwa ... Curves.zip)

It is a single text file with all 201 response curves. LuxCore will read the first one available inside the file (so copy the one you are interested in a new text file or write your own using the same syntax).

This is an example of Ektachrome-320TCD camera response file:

Code: Select all

Ektachrome-320TCDRed
graph-log-log-pos
I =
0.0   [... a long list of values ...]   1.0
B =
0.0   [... a long list of values ...]   1.0
Ektachrome-320TCDGreen
graph-log-log-pos
I =
0.0   [... a long list of values ...]   1.0
B =
0.0   [... a long list of values ...]   1.0
Ektachrome-320TCDBlue
graph-log-log-pos
I =
0.0   [... a long list of values ...]   1.0
B =
0.0   [... a long list of values ...]   1.0
Values are between 0.0 and 1.0. You map Red/Green/Blue "I=" input values in Red/Green/Blue "B=" output values.
Support LuxCoreRender project with salts and bounties
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Analog film simulation file format

Post by Fox »

wasd wrote: Tue May 21, 2019 12:13 pm I would like to know the exact format to make my own presets, if it's not too much trouble.
My method for converting any film simulation from any image editor to crf data under B = data field.

B data fields have 1024 numbers going from 0 to 1.
Therefor i need linear gradient image file with measures 1024 pixel by 1 pixel,
grayscale, but saved in rgb format 32bit float, where values go from 0 to 1.

Apply film simulation to that image file.
Convert R G B channels to separate image files,
saved in grayscale 32bit float.

Open image files with hex editor and view in float format.
Copy normal looking numbers (not e-38) and paste here https://www.browserling.com/tools/spaces-to-newlines
Hit convert spaces, and copy data back to openoffice calc.
You should have 1024 values, if everything looks ok,
then you can set number format in openoffice calc to look like 9.775171e-004
Copy all numbers and paste here https://www.browserling.com/tools/newlines-to-spaces
Hit convert newlines.
Copy data to openoffice writer.
Search spaces and mass replace all single spaces with 3 spaces.
Copy data to crf file under B = line

Do this all with all the R and G and B image files for all the 3 B = fields.
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Analog film simulation file format

Post by Sharlybg »

Hi fox !

Do you think it is also possible to convert LUT .cube format in to CRF file ?
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Analog film simulation file format

Post by Fox »

Sharlybg wrote: Thu May 23, 2019 11:32 am Hi fox !

Do you think it is also possible to convert LUT .cube format in to CRF file ?
The lut cube values go also from 0 to 1.
:roll: Is this really that easy to copy and paste, not sure.
The crf has 1024 values, but cube that i looked had 32768 values.
Does it matter, i think it would work.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Analog film simulation file format

Post by Dade »

Fox wrote: Thu May 23, 2019 11:52 am The crf has 1024 values, but cube that i looked had 32768 values.
CRF can have any amount of values, you have only to have the same number of in and out values, it is the only constrain.
Support LuxCoreRender project with salts and bounties
Post Reply