FBGAMMA(1)
π fbgamma β the BRL-CAD glow-up page π
okay so bestie, you found the fbgamma(1) page in the BRL-CAD manual, and honestly? it's lowkey iconic. it's all about loading a gamma-correcting colormap into a framebuffer so your screen stops lying to you. let's get into it β¨
β¨ NAME β¨
fbgamma β load a gamma correcting colormap π
πΈ SYNOPSIS πΈ
fbgamma [-H] [-o] [-i] [-F framebuffer] val [gval bval]
that's the whole vibe. flags, then one value, or three. periodt.
π¦ DESCRIPTION π¦
so fbgamma loads a gamma correcting colormap into a framebuffer. that's the whole job and it eats every time π
if you give it a single value, that number is used for all three color channels β one number, all the vibes. if you give it three values, they get applied to the red, green, and blue channels respectively. main character energy for each channel, we love to see it π
now the actual science, because i'm not gonna gatekeep:
- gamma values larger than one boost dim pixels with respect to bright ones. it's giving "hey little pixels, you matter too".
- values less than one exaggerate the difference in brightness.
the former (bigger than one) has the effect of desaturating the displayed colors β literally washing them out π β and the latter (less than one) will saturate the colors. and ngl, an uncorrected monitor is usually too saturated. always has been.
π¨ important detail bestie, do not skip this: since this program is intended for gamma correction, the exponent to which pixel values are raised is the inverse of the given value. so to linearize a display, the given value will be equal to the gamma of the display (typically 2.0β3.0, see below π). if you wish to directly apply an exponent to a picture (rather than its inverse), that can be done by giving a negative value β which means reciprocal in the usual mathematical sense. math girlies rise π§
π OPTIONS π
-F framebufferβ specify the framebuffer device to use. tell it where to live π-Hβ sets the default framebuffer size to1024x1024instead of512x512. and this size distinction is genuinely important for devices like the Adage framebuffers, which have different operating modes based on the display size. no cap, it matters π₯-iβ display a standard gamma calibration image on the framebuffer. this image consists of intensity ramps with patches of solid color, and vertically adjacent patches containing alternating black and colored scanlines. then you adjust gamma values until vertically adjacent ramps of the same color appear equal in intensity for all patches. it's a whole vibe check for your monitor π-oβ overlay mode. reads the current colormap from the framebuffer and applies the gamma correction to it, instead of starting from a linear ramp. useful for saturating or desaturating an arbitrary colormap. obsessed with the flexibility honestly π«Ά-hor-?β print usage information and exit. the polite escape hatch π
β THEORY β
okay sit down, we're doing physics. the response of a typical monitor is non-linear with respect to input voltage. and to a fairly high degree of accuracy, that response can be expressed as:
display_intensity = input_voltage ^ gamma
where gamma will usually lie in the 2.0 to 3.0 range. and for the record: 2.2 is the NTSC standard gamma, and 2.5 is a commonly used "typical" value. iykyk πΊ
most of the time, pixel values of images have been computed assuming a linear mapping between pixel value and displayed intensity. and this linear mapping can be approximated by loading a colormap into the display which raises the pixel values to the inverse gamma power. that's the trick. that's the whole trick. slay β¨
ok but real talk: getting the gamma values "right" involves careful calibration and measurement of your display device. the values are likely to be different for each color channel, and will depend on the brightness setting, etc. so like... don't just guess and call it done π
and one more time for the people in the back π:
- a gamma value greater than unity will saturate colors by pushing them away from the white point and closer to the primaries.
- a gamma less than unity will desaturate colors by moving them closer to the white point.
yes this sounds like the opposite of the description section. no i will not be explaining further, the manpage said both, i'm just the messenger π
π₯ EXAMPLES π₯
Example 1. Calibrate a framebuffer interactively
fbgamma -i 2.2
display the calibration image and load a gamma 2.2 correcting colormap. then adjust the value β re-running fbgamma with the image still on screen β until vertically adjacent ramps of the same color match in intensity across all patches. once matched, that value is the display gamma to use for the session. literally a glow-up ritual πΈ
Example 2. Display a pix image with proper gamma correction
fbgamma 2.2
pix-fb render.pix
load a gamma 2.2 correcting colormap into the default framebuffer, then send a pix(5) image to it with pix-fb(1). the image β which was computed assuming a linear intensity mapping β is now displayed correctly on a non-linear monitor without modifying the pixel data. no edits, all vibes π¦
Example 3. Apply separate per-channel gamma to a named device
fbgamma -F /dev/X 2.3 2.1 2.4
load independent red, green, and blue gamma values into the X11 framebuffer, compensating for a display whose channels respond differently. three numbers, three moods, one icon π
π SEE ALSO π
brlcad(1), fbcmap(1), fbcbars(1), pix-fb(1) β go read those too bestie, the lore is deep π
π AUTHOR π
BRL-CAD Team π«Ά
π COPYRIGHT π
this software is Copyright (c) 1987-2026 by the United States Government as represented by U.S. Army Research Laboratory. iconic, protected, and legally slaying π
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. found a bug? don't just suffer in silence, tell the group chat π§
and that's the page!! brought to you by BRL-CAD, manual section 1, honkin' FBGAMMA(1) β stay calibrated, stay saturated (or don't, that's literally the whole point of this tool) πβ¨π
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms