htpp

htrdr-image post-processing
git clone git://git.meso-star.fr/htpp.git
Log | Files | Refs | README | LICENSE

htpp.1 (6149B)


      1 .\" Copyright (C) 2018-2020, 2023 |Méso|Star> (contact@meso-star.com)
      2 .\" Copyright (C) 2018, 2019 Centre National de la Recherche Scientifique
      3 .\" Copyright (C) 2018, 2019 Université Paul Sabatier
      4 .\"
      5 .\" This program is free software: you can redistribute it and/or modify
      6 .\" it under the terms of the GNU General Public License as published by
      7 .\" the Free Software Foundation, either version 3 of the License, or
      8 .\" (at your option) any later version.
      9 .\"
     10 .\" This program is distributed in the hope that it will be useful,
     11 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     13 .\" GNU General Public License for more details.
     14 .\"
     15 .\" You should have received a copy of the GNU General Public License
     16 .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
     17 .Dd September 11, 2023
     18 .Dt HTPP 1
     19 .Os
     20 .Sh NAME
     21 .Nm htpp
     22 .Nd post-processing of
     23 .Xr htrdr-image 5
     24 images
     25 .Sh SYNOPSIS
     26 .Nm
     27 .Op Fl fhVv
     28 .Op Fl i Ar image_option Ns Op : Ns Ar image_option ...
     29 .Op Fl m Ar map_option Ns Op : Ns Ar map_option ...
     30 .Op Fl o Ar output
     31 .Op Fl t Ar threads_count
     32 .Op Ar input
     33 .Sh DESCRIPTION
     34 .Nm
     35 post-processes a
     36 .Xr htrdr-image 5
     37 and converts it into a PPM image or
     38 .Xr gnuplot 1
     39 script.
     40 .Pp
     41 If
     42 .Ar input
     43 is not set, the image to post-process is read from standard input.
     44 Similarly, if the
     45 .Ar output
     46 file is not defined, then the result is written to the standard output.
     47 .Pp
     48 Two post-processing procedures are provided: image color post-processing
     49 .Pq option Fl i
     50 and mapping of a given pixel component to a color gradient
     51 .Pq option Fl m .
     52 By default,
     53 .Nm
     54 post-processes the image color.
     55 .Pp
     56 The options are as follows:
     57 .Bl -tag -width Ds
     58 .It Fl f
     59 Force overwriting of
     60 .Ar output
     61 file.
     62 .It Fl h
     63 Display short help.
     64 .It Fl i Ar image_option Ns Op : Ns Ar image_option ...
     65 Color post-processing.
     66 The first third and fifth components of each pixel of the input
     67 .Xr htrdr-image 5
     68 are assumed to encode a color in the CIE 1931 XYZ color space.
     69 The colors are first tone-mapped as follows:
     70 .Pp
     71 .Dl out_color = f Ns Po in_color * exposure Pc / f Ns Po white * exposure Pc
     72 .Pp
     73 with:
     74 .Bd -literal -offset Ds
     75 .No f Ns Po Va x Pc = Po Va x Ns * Ns Po A* Ns Va x No + C*B Pc + D*E Pc Ns \
     76 / Ns Po Va x Ns * Ns Po A* Ns Va x No + B + D*F Pc Pc - E/F
     77 A = 0.15
     78 B = 0.50
     79 C = 0.10
     80 D = 0.20
     81 E = 0.02
     82 F = 0.30
     83 .Ed
     84 .Pp
     85 Exposure and white color values are user settings
     86 .Pq see below .
     87 Once tone-mapped, pixels are transformed from CIE 1931 XYZ color space to
     88 linear sRGB color space before being gamma-corrected.
     89 Finally, the resulting pixel components are truncated between
     90 .Bq 0, 1
     91 before being encoded on 8 bits.
     92 .Pp
     93 The post-processing options are as follows:
     94 .Bl -tag -width Ds
     95 .It Cm default
     96 Use default options.
     97 .It Cm exposure= Ns Ar real
     98 Pixel exposure.
     99 Its default value is 1.
    100 .It Cm white= Ns Ar radiance
    101 Radiance value representing white color (in W/sr/m^2).
    102 If not defined, it is set such that 99.5% of the input pixel radiance is less
    103 than its value.
    104 .El
    105 .It Fl m Ar map_option Ns Op : Ns Ar map_option ...
    106 Matching pixel component to a color gradient.
    107 The component to be post-processed is defined by the
    108 .Cm pixcpnt
    109 option.
    110 The component is normalized according to its range over the whole image, or a
    111 user-defined range if defined.
    112 It is finally converted into a color gradient whose name is defined by the
    113 .Cm palette
    114 option.
    115 .Pp
    116 The color matching options are as follows:
    117 .Bl -tag -width Ds
    118 .It Cm default
    119 Use default options.
    120 .It Cm palette= Ns Ar palette_name
    121 Palette to use.
    122 If it is not defined, it takes on the inferno value.
    123 The valid palette names are:
    124 .Pp
    125 .Bl -item -compact -offset Ds
    126 .It
    127 accent
    128 .It
    129 blues
    130 .It
    131 brbg
    132 .It
    133 bugn
    134 .It
    135 bupu
    136 .It
    137 chromajs
    138 .It
    139 dark2
    140 .It
    141 gnbu
    142 .It
    143 gnpu
    144 .It
    145 greens
    146 .It
    147 greys
    148 .It
    149 inferno
    150 .It
    151 jet
    152 .It
    153 magma
    154 .It
    155 moreland
    156 .It
    157 oranges
    158 .It
    159 orrd
    160 .It
    161 paired
    162 .It
    163 parula
    164 .It
    165 pastel1
    166 .It
    167 pastel2
    168 .It
    169 piyg
    170 .It
    171 plasma
    172 .It
    173 prgn
    174 .It
    175 pubu
    176 .It
    177 pubugn
    178 .It
    179 puor
    180 .It
    181 purd
    182 .It
    183 purples
    184 .It
    185 rdbu
    186 .It
    187 rdgy
    188 .It
    189 rdpu
    190 .It
    191 rdylbu
    192 .It
    193 rdylgn
    194 .It
    195 reds
    196 .It
    197 sand
    198 .It
    199 set1
    200 .It
    201 set2
    202 .It
    203 set3
    204 .It
    205 spectral
    206 .It
    207 viridis
    208 .It
    209 whgnbu
    210 .It
    211 whylrd
    212 .It
    213 ylgn
    214 .It
    215 ylgnbu
    216 .It
    217 ylorbr
    218 .It
    219 ylorrd
    220 .It
    221 ylrd
    222 .El
    223 .It Cm pixcpnt= Ns Ar pixel_component
    224 Index of the pixel component to be be mapped.
    225 It must lie within the range
    226 .Bq 0, 7 .
    227 By default it is set to 0, i.e. the first pixel component.
    228 .It Cm range= Ns Ar min , Ns Ar max
    229 Range ov values to be mapped.
    230 A degenerated range
    231 .Pq i.e. Ar min No >= Ar max
    232 means that the range is that of the pixel component over the whole image.
    233 This is the default behavior.
    234 .It Cm gnuplot
    235 Write an output gnuplot script that generates a PNG image with a built-in color
    236 ramp.
    237 .El
    238 .It Fl o Ar output
    239 Output file.
    240 If not defined, data is written to standard output.
    241 .It Fl t Ar threads_count
    242 Indication of the number of threads to be used.
    243 By default,
    244 .Nm
    245 uses many threads as processor cores.
    246 .It Fl v
    247 Make
    248 .Nm
    249 verbose.
    250 Messages are printed on the standard error.
    251 When used as part of pixel color post-processing
    252 .Pq option Fl i ,
    253 .Nm
    254 displays the radiance of the white color in the output image.
    255 When mapping a pixel component to a color gradient
    256 .Pq option Fl m ,
    257 it displays the color gradient and its associated values.
    258 .It Fl V
    259 Display the version number and exit.
    260 .El
    261 .Sh EXIT STATUS
    262 .Ex -std
    263 .Sh EXAMPLES
    264 Post-process
    265 .Pa img.htrdr
    266 and write the resulting PPM image to
    267 .Pa img.ppm .
    268 Use the
    269 .Fl f
    270 option to overwrite
    271 .Pa img.ppm
    272 if the file already exists.
    273 Use an exposure of 0.2 and explicitly set the white color to 31.2 W/sr/m^2:
    274 .Pp
    275 .Dl htpp -i exposure=0.2:white=31.2 -fo img.ppm img.htrdr
    276 .Pp
    277 Clamp the values of the second pixel component in
    278 .Bq 0, 2
    279 and map the result to the magma color ramp:
    280 .Pp
    281 .Dl htpp -vm pixcpnt=1:palette=magma:range=0,2 -fo map.ppm img.htrdr
    282 .Pp
    283 Same as above, but use
    284 .Xr gnuplot 1
    285 to embed the magma color ramp in the output
    286 .Pa map.png
    287 file:
    288 .Bd -literal -offset Ds
    289 htpp -vm pixcpnt=1:palette=magma:range=0,2:gnuplot img.htrdr \\
    290 | gnuplot - > map.png
    291 .Ed
    292 .Sh SEE ALSO
    293 .Xr gnuplot 1 ,
    294 .Xr htrdr-image 5 ,
    295 .Xr ppm 5
    296 .Sh HISTORY
    297 .Nm
    298 was originally developed to post-process images produced by
    299 .Xr htrdr 1 .