htrdr 0.9.2

htpp(1)

NAME

htpp - High-Tune: Post-Process

SYNOPSIS

htpp [option] ... [input]

DESCRIPTION

htpp post-processes an htrdr-image(5) and converts it to a PPM [1] image or a gnuplot(1) script. If input is not defined, the input image is read from standard input. Two post-processing procedures are provided: image color post-processing (-i option) and mapping of a given pixel component to a color gradient (-m option). By default, htpp post-processes the color of the image.

Color post-processsing

To post-process image colors (-i option) htpp assumes that the first, third and fifth components of each input pixel encode a color in the CIE 1931 XYZ color space. First, htpp applies tone correction to these colors via the following filmic tone mapping operator [2]:

out-color = f(in-color * exposure) / f(white-value * exposure)

with:

f(x) = (x * (A*x + C*B) + D*E) / (x*(A*x + B + D*F)) - E/F

A = 0.15
B = 0.50
C = 0.10
D = 0.20
E = 0.02
F = 0.30

The term exposure is a user-defined parameter provided via the exposure image option. If not set, a default exposure of 1 is used. The white-value is either set by the user via the white image option or calculated automatically as the luminance such that 99.5% of the pixel luminances are below white-value.

After the tone correction function is applied, pixels are transformed from the CIE 1931 XYZ color space to the linear sRGB color space before being gamma corrected. Finally, the resulting pixel components are truncated between [0, 1] and finally encoded to 8 bits.

Map a value to a color gradient

The mapping of a pixel component to a color gradient is controlled by the -m option. The pixel component to be post-processed is defined by the pixcpnt mapping option. htpp normalizes this component to its range across the whole image or to the range mapping option if set. The resulting value is then mapped to a color gradient whose name is defined by the palette mapping option; see the PALETTES section for a list of available color gradients.

OPTIONS

-f

Force overwrite of the output file.

-h

List short help and exit.

-i <sub-option>[:<sub-option> ...]

Post-process the color of the htrdr-image(5). The first, the third and the fifth pixel components are assumed to store the pixel color encoded into the CIE 1931 XYZ color space. Available sub-options are:

default

Use the default values of the sub-options.

exposure=real

Pixel exposure. By default its value is 1.

white=radiance

Radiance in the input image that will represent the white color in output. If not defined, the white value is automatically computed from the radiance of the input image.
-m <sub-option>[:<sub-option> ...]
Map a pixel component to a regular color. Available sub options are:

default

Use the default values of the sub-options.

palette=palette-name

Color palette to use. See the PALETTES section for a complete list of supported palettes. The default palette is inferno.

pixcpnt=pixel-component

Index in [0, 7] of the pixel component to map. The default pixel component is the first one, i.e. pixcpnt=0.

range=min,max

Range of the values to map. A degenerated range (i.e. min >= max) means that this range is automatically computed from the boundaries of the selected pixel component over the whole image. This is the default comportment.

gnuplot

The output image is formatted as a gnuplot script rather than a PPM image. Once executed, the script generates a PNG image with an embedded color ramp. Note that this script can be edited in order to adjust the generated image to any requirements.
-o output
File where the result is written. If not defined, write output to standard output.

-t threads-count

Hint on the number of threads to use. By default use as many threads as CPU cores.

-v

Make htpp verbose. When used in pixel color post-processing (-i option), htpp displays the radiance of the white color in the output image. When mapping a pixel component to a color gradient (-m option), htpp displays the color gradient and its associated values.

--version

Display version information and exit.

EXAMPLES

Post-process the htrdr-image(5) saved in img.htrdr and write the resulting PPM image in img.ppm. Use the -f option to overwrite img.ppm if it already exists:

htpp -f -o img.ppm img.htrdr

Convert img.htrdr and visualise the resulting image by redirecting the standard output to the feh(1) image viewer. Use an exposure of 0.2 and explicitly define the white color to 31.2 W/sr/m²:

htpp -i exposure=0.2:white=31.2 img.htrdr | feh -

Use the -m option to map the values of the second pixel component clamped in [0, 2] to the color ramp magma.

htpp -v -m pixcpnt=1:palette=magma:range=0,2 img.htrdr | feh -

Use the -m option to map the values of the sixth pixel component and write it as a gnuplot script. Run gnuplot(1) to generate a PNG of the result and visualise the resulting image with feh(1).

htpp -m pixcpnt=6:gnuplot -o img.gp img.htrdr
gnuplot img.gp | feh -

PALETTES

This section lists the available palettes that can be used to map a pixel component to a color (-m option):

*
accent
*
blues
*
brbg
*
bugn
*
bupu
*
chromajs
*
dark2
*
gnbu
*
gnpu
*
greens
*
greys
*
inferno
*
jet
*
magma
*
moreland
*
oranges
*
orrd
*
paired
*
parula
*
pastel1
*
pastel2
*
piyg
*
plasma
*
prgn
*
pubu
*
pubugn
*
puor
*
purd
*
purples
*
rdbu
*
rdgy
*
rdpu
*
rdylbu
*
rdylgn
*
reds
*
sand
*
set1
*
set2
*
set3
*
spectral
*
viridis
*
whgnbu
*
whylrd
*
ylgn
*
ylgnbu
*
ylorbr
*
ylorrd
*
ylrd

COPYRIGHT

Copyright © 2018, 2019, 2020, 2023 |Méso|Star> <contact@meso-star.com>
Copyright © 2018, 2019 Centre National de la Recherche Scientifique
Copyright © 2018, 2019 Université Paul Sabatier

LICENSE

htpp is free software released under the GPLv3+ license: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. You are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

SEE ALSO

1.
Portable PixMap - <http://netpbm.sourceforge.net/doc/ppm.html>
2.
Filmic tone mapping operator - <http://filmicworlds.com/blog/filmic-tonemapping-operators/>
3.
Star-ColorMap - <https://gitlab.com/meso-star/star-cmap>

feh(1), gnuplot(1), htrdr-image(5)