pfsdisplayfunction(1)

πŸ’– pfsdisplayfunction(1) β€” the glow-up page πŸ’–

okay bestie, so this is the manual for pfsdisplayfunction, which lives in the General Commands Manual section, and honestly? it's giving "science but make it cute". it converts your pixels into actual real-world light units, or does the reverse. no cap. πŸ¦‹


✨ NAME ✨

pfsdisplayfunction β€” apply a display function to color or gray-scale images πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

pfsdisplayfunction [--display-function <df-spec>] [--to-pixels | --to-luminance] [--help] [--verbose]

🌸 DESCRIPTION 🌸

so like, use this command when you wanna convert pixel values into luminance / radiance units β€” the ones an actual monitor actually shows β€” or when you wanna do the whole conversion but backwards. inverse era. πŸ”„

it's lowkey iconic in combination with the HDR-VDP, where you use it to turn LDR images into luminance maps that represent the image as shown on one particular display. the display function specification is identical to the one used in the pfstmo_mantiuk08 tone mapping operator (that's from the pfstmo package, iykyk). πŸ’–

now here's the part where it's smart: if you don't specify --to-luminance or --to-pixels, it figures out which direction you want on its own, by reading the LUMINANCE tag in the pfs stream. main character energy fr fr. ✨


πŸ’œ OPTIONS πŸ’œ

  • --to-luminance, -l β€” converts pixel values into absolute luminance / radiance units. for RGB images, the same display function gets applied in every single color channel. no favorites. 🌈
  • --to-pixels, -p β€” converts absolute luminance / radiance units back into pixel values. and yep, for RGB images the same display function is applied in each color channel here too. πŸŽ€
  • --display-function <df-spec>, -d <df-spec> β€” this is the display function, and it describes how a display's output luminance changes with pixel values. if you don't hand it a parameter, the command just assumes -df pd=lcd (peep Pre-defined display below for that one). there are several ways to specify it, and we're going through all of them: 🫢

🌟 Gamma-gain-black-ambient display model 🌟

g=<float>:l=<float>:b=<float>:k=<float>:a=<float>[:n=<float>]

the gamma-gain-black-ambient model can approximate a whole range of displays and it's a compact way to specify a display function. it assumes the display function has this exact form:

L_d(I) = (l-b)*I^gamma + b + k/pi*a

and the parameters are as follows, bestie:

  • g β€” gamma, aka the exponent of a display function (default 2.2, usually from 1.8 to 2.8)
  • l β€” peak luminance of a display in cd/m^2 (default 100, from 80 for CRTs to 500 or more for newer displays)
  • b β€” black level, which is the luminance of a black pixel when the display is on (default 1, usually from 0.3 to 1 cd/m^2)
  • k β€” reflectivity of a screen (assuming that it is diffuse) (default 0.01, usually about 0.01 (1%) for LCD displays, more for CRTs)
  • a β€” ambient illumination in lux. typical values are:
    • 50 lux β€” Family living room (dim, default)
    • 400 lux β€” A brightly lit office
    • 32000 lux β€” Sunlight on an average day (min.)
    • 100000 lux β€” Sunlight on an average day (max.)

🌈 Pre-defined display 🌈

pd=<display_type>

use a pre-defined display type. these options are for convenience only, and ngl they do not mean to accurately model the response of a particular display. the following display types are recognized:

  • lcd_office (g=2.2, l=100, b=0.8, k=0.01, a=400 ) β€” lcd set to "office" mode seen in bright environment
  • lcd (g=2.2, l=200, b=0.8, k=0.01, a=60 ) β€” typical lcd seen in dim environment (default)
  • lcd_bright (g=2.6, l=500, b=0.5, k=0.01, a=10 ) β€” newer LCD TV seen in dark environment
  • crt (g=2.2, l=80, b=1, k=0.02, a=60 ) β€” CRT monitor seen in dim environment

the parameters in the parenthesis are the same as for the gamma-gain-black-ambient model explained above. πŸ‘‘

πŸ¦‹ Lookup-table πŸ¦‹

lut=<file>

this one is the most accurate specification of the display response function, but it requires measuring it with a luminance meter. it should also account for ambient light, so it's recommended that you use a luminance meter that can measure screen luminance from a distance, like the Minolta LS-100 β€” as opposed to those that use a rubber tube touching a display, which eliminates the influence of ambient light. 🫣

the <file> must be a comma-separated text file in a format (CSV) with two columns: the first column represents pixel values (from 0.0 to 1.0) and the second is physical luminance in cd/m^2. both the pixel value and the luminance should increase in each raw. πŸ“ˆ


πŸ”₯ EXAMPLES πŸ”₯

pfsin barbara.jpg | pfsdisplayfunction -l -d pd:crt -v  | pfsout barbara_crt.hdr

convert the barbara.jpg image from pixel values to a luminance map of the image shown on a CRT monitor, and store that map as an HDR image. she ate. πŸ’…


⭐ SEE ALSO ⭐

pfsgamma(1) pfstmo_mantiuk08(1)


πŸ’€ BUGS πŸ’€

please report bugs and comments to the pfstools discussion group (http://groups.google.com/group/pfstools). they wanna hear from you fr fr. πŸ™ˆ


πŸŽ€ and that's the whole page, bestie. this was pfsdisplayfunction(1) from the General Commands Manual β€” go forth, convert those pixels, and slay. periodt. βœ¨πŸ’–πŸ¦‹πŸŒΈ

mwah πŸ’œ β€” that's the pfsdisplayfunction(1) page from the General Commands Manual, so go convert some pixels and be iconic. πŸŽ€βœ¨