HTPP(1) | General Commands Manual | HTPP(1) |
NAME
htpp
—
post-processing of
htrdr-image(5)
images
SYNOPSIS
htpp |
[-fhVv ] [-i
image_option[:image_option
...]] [-m
map_option[:map_option ...]]
[-o output]
[-t threads_count]
[input] |
DESCRIPTION
htpp
post-processes a
htrdr-image(5) and
converts it into a PPM image or
gnuplot(1) script.
If input is not set, the image to post-process is read from standard input. Similarly, if the output file is not defined, then the result is written to the standard output.
Two post-processing procedures are provided: image color
post-processing (option -i
) and mapping of a given
pixel component to a color gradient (option -m
). By
default, htpp
post-processes the image color.
The options are as follows:
-f
- Force overwriting of output file.
-h
- Display short help.
-i
image_option[:image_option ...]- Color post-processing. The first third and fifth components of each pixel
of the input
htrdr-image(5) are
assumed to encode a color in the CIE 1931 XYZ color space. The colors are
first tone-mapped as follows:
out_color = f(in_color * exposure) / f(white * 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
Exposure and white color values are user settings (see below). Once tone-mapped, pixels are transformed from CIE 1931 XYZ color space to linear sRGB color space before being gamma-corrected. Finally, the resulting pixel components are truncated between [0, 1] before being encoded on 8 bits.
The post-processing options are as follows:
-m
map_option[:map_option ...]- Matching pixel component to a color gradient. The component to be
post-processed is defined by the
pixcpnt
option. The component is normalized according to its range over the whole image, or a user-defined range if defined. It is finally converted into a color gradient whose name is defined by thepalette
option.The color matching options are as follows:
default
- Use default options.
palette=
palette_name- Palette to use. If it is not defined, it takes on the inferno value.
The valid palette names are:
- 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
pixcpnt=
pixel_component- Index of the pixel component to be be mapped. It must lie within the range [0, 7]. By default it is set to 0, i.e. the first pixel component.
range=
min,max- Range ov values to be mapped. A degenerated range (i.e. min >= max) means that the range is that of the pixel component over the whole image. This is the default behavior.
gnuplot
- Write an output gnuplot script that generates a PNG image with a built-in color ramp.
-o
output- Output file. If not defined, data is written to standard output.
-t
threads_count- Indication of the number of threads to be used. By default,
htpp
uses many threads as processor cores. -v
- Make
htpp
verbose. Messages are printed on the standard error. When used as part of pixel color post-processing (option-i
),htpp
displays the radiance of the white color in the output image. When mapping a pixel component to a color gradient (option-m
), it displays the color gradient and its associated values. -V
- Display the version number and exit.
EXIT STATUS
The htpp
utility exits 0 on
success, and >0 if an error occurs.
EXAMPLES
Post-process img.htrdr and write the
resulting PPM image to img.ppm. Use the
-f
option to overwrite
img.ppm if the file already exists. Use an exposure
of 0.2 and explicitly set the white color to 31.2 W/sr/m^2:
htpp -i exposure=0.2:white=31.2 -fo
img.ppm img.htrdr
Clamp the values of the second pixel component in [0, 2] and map the result to the magma color ramp:
htpp -vm
pixcpnt=1:palette=magma:range=0,2 -fo map.ppm img.htrdr
Same as above, but use gnuplot(1) to embed the magma color ramp in the output map.png file:
htpp -vm pixcpnt=1:palette=magma:range=0,2:gnuplot img.htrdr \ | gnuplot - > map.png
SEE ALSO
HISTORY
htpp
was originally developed to
post-process images produced by
htrdr(1).
September 11, 2023 | UNIX |