fakeread
Author: Graeme Gill

## spectro/fakeread

### Summary

Simulate the measurement of a devices response, using an existing device profile, or measured test point data set. The device profile can be either an ICC or MPP profile, or the data set can be a .ti3 file. A device link separation or color space conversion can be applied before the print/measure simulation, as well as device calibration or inverse calibration curves.
fakeread can be useful for creating a data set from an existing profile to re-create a different style of profile (i.e. create a cLUT profile from a matrix profile), for creating synthetic data sets with known amounts of randomness for testing profile creation against a perfectly known ideal, or for creating verification test sets for checking colorimetric colorspace emulation against.
The options below are in the order of color processing that fakeread performs.

### Usage

`fakeread [-options] profile.[icm|mpp|ti3] inoutfile``
` `-v [n] Verbose mode [level]``
` `-e flag Video encode device input to sepration as:``
` `n normal 0..1 full range RGB levels (default)``
` `t (16-235)/255 "TV" RGB levels``
` `6 Rec601 YCbCr SD (16-235,240)/255 "TV" levels``
` `7 Rec709 1125/60Hz YCbCr HD (16-235,240)/255 "TV" levels``
` `5 Rec709 1250/50Hz YCbCr HD (16-235,240)/255 "TV" levels``
` `2 Rec2020 YCbCr UHD (16-235,240)/255 "TV" levels``
` `C Rec2020 Constant Luminance YCbCr UHD (16-235,240)/255 "TV" levels``
` `-p separation.icm Use device link separation profile on input``
` `-E flag Video decode separation device output. See -e above``
` `-Z nbits Quantize test values to fit in nbits``
` `-k file.cal Apply calibration (include in .ti3 output)``
` `-i file.cal Include calibration in .ti3 output, but don't apply it``
` `-K file.cal Apply inverse calibration`
`-r level Add average random deviation of <level>% to device values (after sep. & cal.)``
` `-0 pow Apply power to device chanel 0-9``
` `-B display.icm Use BT.1886 source EOTF with technical gamma 2.4``
` `-b g.g:display.icm Use BT.1886-like source EOTF with effective gamma g.g``
` `-b p.p:g.g:display.icm Use effective gamma g.g source EOTF with p.p prop. output black point offset``
` `-g g.g:display.icm Use effective gamma g.g source EOTF with all output black point offset``
` `-I intent r = relative colorimetric, a = absolute (default)``
` `-A L,a,b Scale black point to target Lab value``
` `-l Output Lab rather than XYZ``
` `-s Lookup` `MPP` `spectral values``
` `-R level Add average random deviation of <level>% to output PCS values``
` `-u Make random deviations have uniform distributions rather than normal``
` `-S seed Set random seed``
` `-U Reverse convert PCS to device, output_r.ti3``
` `profile.[icm|mpp|ti3]` `ICC``,` `MPP` `or` `.ti3` `profile/file to use``
` `inoutfile Base name for input[``.ti1``]/output[``.ti3``] file``
` ``
Examples
fakeread profile.icm testvalues
fakeread -p separation.icm profile.icm testvalues

### Comments

The -v flag reports extra information, e.g. on what BT.1886 option is doing. A level > 1 will be more verbose.
The -e flag applies a Video encoding to the input of the separation.
n normal 0..1 full range RGB levels (default)
t (16-235)/255 "TV" RGB levels
6 Rec601 YCbCr SD (16-235,240)/255 "TV" levels
7 Rec709 1125/60Hz YCbCr HD (16-235,240)/255 "TV" levels
5 Rec709 1250/50Hz YCbCr HD (16-235,240)/255 "TV" levels
2 Rec2020 YCbCr UHD (16-235,240)/255 "TV" levels
C Rec2020 Constant Luminance YCbCr UHD (16-235,240)/255 "TV" lev
The -p separation.icm option enables a device to device value conversion before converting to expected PCS values. This might be an ink separation of a video calibration device link. The argument is the name of the ICC device link that defines the separation.
The -E flag applies a Video decoding to the output of the separation. See -e for the list of decodings. Setting a video encoding for output will also set quantization of 8 bits (see -Z flag below). If your video connection is better than 8 bits (ie. 10 or 12 bits), then you may wish to raise this default.
-Z nbits Normally the target device values are floating point numbers that may get rounded and quantized in the process of printing them or reproducing them on the display device. If some of this quantization can be accounted for, it may improve the accuracy of the resulting profile, and the Q parameter allows this quantization to be specified. The parameter is the number of binary digits (bits) that the device values should be quantized to. An idea of the number of bits of precision that makes its way to your display can be obtained by using dispcal -R If Video encoding is selected (see -E flag above), then 8 bits is selected by default. On systems using an VGA connection or Display Port with a graphics card with VideoLUT entries with greater than 8 bits depth, or if using the MadVR rendered with dithering, then a higher bit depth is typically possible.
The -k file.cal parameter specifies a calibration file created by printcal or dispcal, and the supplied calibration curves will be applied to the chart device values after any separation and before the device profile. This allows emulating a system that uses per device channel calibration. The calibration curves will also be included in the resulting .ti3 file, so that they can be passed through to the ICC profile allowing accurate computation of ink limits.
The -i file.cal parameter specifies a printer calibration file created by printcal or dispcal, and the calibration curves will be included in the included in the resulting .ti3 file, so that they can be passed through to the ICC profile, to allow accurate computation of ink limits. The calibration is not applied to tchart values. Note that if the supplied ICC profile contains VCGT calibration curves, that these will be included in the resulting .ti3 by default.
The -K file.cal parameter specifies a calibration file created by printcal or dispcal, and the inverse of the supplied calibration curves will be applied to the chart device values after any separation and before the device profile. This allows for undoing calibration curves that may be part of a video calibration device link, so that the (calibrated device value) device profile will work as expected.
The -r parameter is a way of simulating instability in the behaviour of the simulated printing system. The parameter supplied to the flag will be used to scale a random offset added to the device values (after any separation and calibration is applied). The offset will be a normally distributed error with an average deviation of level%. A typically value supplied might be 1.0 to simulate 1% randomness.
The -0, -1, -2 .. -9 parameters are a way of simulating changes in the behavior of the simulated printing system. The parameter supplied to the flag will be used to modify the device values (after any separation, calibration and device randomness is applied) by raising them to the power of the parameter. This applies a transfer curve to the simulated device response.
The -[b|B|g|G] [p.p:][g.g:]display.icm series of options, substitutes an alternative EOTF (Electro-Optical Transfer Function) for the one specified by the matrix input profile. display.icm is the display ICC profile that provides the black point that the gamma curve curves will target. Typically these options will be used to create a verification test set for checking the operation of a device link or 3dLut created using collink, using the same gamma curve parameters. See collink -I b for a full explanation of these parameters, and Verifying Video Calibration for more detail.
The -I parameter allows changing the intent used in looking up the ICC profile colors to relative colorimetric. This would not be used if you intend to make a profile from the resulting .ti3 file, since profiles are always made from absolute colorimetric measurement values. Note that this flag does nothing if the profile is an MPP or .ti3 file.
The -A parameter is a way of simulating devices that have a different black point to the profile used. This only works if an ICC profile is used, and scales the black point to the parameter value. This will be done in XYZ space by default, and in L*a*b* space if the -l flag is used.
The -l flag causes the CIE output values to be L*a*b* rather than the default XYZ values.
The -s flag works if a spectral MPP file is being used as a device profile, and causes the output to include spectral values.
The -R parameter is a way of simulating instability in the behavior of the simulated measuring system. The parameter supplied to the flag will be used to scale a random offset added to the PCS values. The offset will be a normally distributed error with an average deviation of level%. A typically value supplied might be 1.0 to simulate 1% randomness.
The -u flag changes the distribution of the random offsets applied using the -r or -R flags, from the default standard deviation, to a uniform deviation distribution. The level is still specified as an average deviation.
The -S parameter lets a particular random seed be used when generating random offsets, so that the randomness can be made repeatable. Normally a different seed will be used for each run.
The -U flag causes fakeread to read inoutfile.ti3 and use a backwards lookup (CIE to device conversion), saving the result in inoutfile_r.ti3.
Fakeread is useful in creating artificial test value for testing colprof, as well as providing one path for turning an MPP profile into an ICC profile. It can also be used to create a reference file for verifying against. If a .ti3 file is specified instead of an ICC or MPP profile, then the closest matching measured points in the ..ti3 are substituted for the test values in the .ti1 file on output. If the .ti1 file is a monochrome test file with a White device value, then an RGB ICC profile, MPP or .ti3 may be used, and the White values will be translated to equal RGB values. If the .ti1 file is a monochrome test file with a Black device value, then a CMYK ICC profile, MPP or .ti3 may be used, and the Black values will be translated to equal CMY = 0, K = grey values. Note that any calibration within a supplied ICC profile is not applied during the conversion, although it will be included in the .ti3 output (see -k and -i flags for how apply calibration curves during the conversion and/or include a specific calibration curves in the output).
If a separation device profile is provided (e.g. from CMY -> CMYK, or perhaps CMYK->CMYK, to simulate a color correction step before "printing", or perhaps a Video RGB->RGB calibration link) then this will be applied to the .ti1 device values, before converting the the device values into .ti3 PCS values.
Note that a .ti3 file can be renamed to be .ti1 and fakeread will treat it as if it was a .ti1.