Page 1 of 1

Analog film simulation file format

Posted: Tue May 21, 2019 8:20 am
by wasd
What is the format of a file for analog film simulation preset?

Re: Analog film simulation file format

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

But we talk to support 3d LUT file format like .cube

Re: Analog film simulation file format

Posted: Tue May 21, 2019 9:07 am
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.

Re: Analog film simulation file format

Posted: Tue May 21, 2019 10:28 am
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).

Re: Analog film simulation file format

Posted: Tue May 21, 2019 12:13 pm
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.

Re: Analog film simulation file format

Posted: Wed May 22, 2019 2:19 pm
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.

Re: Analog film simulation file format

Posted: Thu May 23, 2019 10:42 am
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.

Re: Analog film simulation file format

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

Do you think it is also possible to convert LUT .cube format in to CRF file ?

Re: Analog film simulation file format

Posted: Thu May 23, 2019 11:52 am
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.

Re: Analog film simulation file format

Posted: Thu May 23, 2019 5:35 pm
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.