Gamma (γ) in HTML
Gamma is the third Greek letter, written Γ and γ. The capital is at U+0393 and the small letter at U+03B3.
At a glance
- Character
- Γ γ
- Named entity
- Γ γ
- Decimal reference
- Γ γ
- Hex reference
- Γ γ
- Unicode code point
- U+0393, U+03B3
- Unicode name
- GREEK CAPITAL LETTER GAMMA, GREEK SMALL LETTER GAMMA
- In the entity reference
- Greek
In detail
Gamma is best known on the web as the exponent in the relationship between a stored pixel value and the light a display emits. The encoding is not linear, and it is not an accident: human vision is more sensitive to differences in dark tones than bright ones, so spending more of the available bits on the dark end produces a better looking image at the same file size.
This is why averaging two colours by averaging their stored values gives a result that looks too dark. The values are gamma encoded, so the arithmetic mean of two encoded numbers is not the encoding of the mean brightness. Image processing that cares about correctness converts to a linear space, does the maths, and converts back.
The capital gamma names an entirely different thing, the gamma function, which extends the factorial to non integer arguments. It appears in statistics, in the gamma distribution and in a good deal of physics, and the shared letter with the display exponent is pure coincidence.
Gamma also names the highest energy band of electromagnetic radiation, which is where the letter turns up in physics and medical imaging contexts. Three unrelated meanings in three fields is more than most Greek letters manage, so the letter alone is never enough context in a technical document.
Examples
<p>displayed = stored<sup>γ</sup>, with γ near 2.2 for a standard display</p>// wrong: averages encoded values
const mid = (a + b) / 2;
// right: decode, average, re-encode
const lin = (v) => Math.pow(v / 255, 2.2);
const enc = (v) => Math.round(Math.pow(v, 1 / 2.2) * 255);
const better = enc((lin(a) + lin(b)) / 2);Things that catch people out
- Averaging or scaling gamma encoded pixel values directly darkens the result. The error is small for similar colours and obvious for a black to white blend.
- The capital gamma is the gamma function and the small gamma the display exponent. Neither is interchangeable with the other.
- A gamma value quoted without saying whether it is the encoding exponent or its reciprocal is ambiguous, and the two are inverses of each other.
Try it: HTML Entity Reference
Search 152 entities across 9 categories, switch the copy format between the character, the name, the decimal form and the hex form, and copy in one click.
HTML Entity Reference
LOCAL · Browser-OnlySearchable reference of 150+ HTML entities with one-click copy in any format
152 entities across 9 categories
Commonly Used
→Arrows(13)
±Math(35)
$Currency(8)
…Punctuation(21)
©Symbols(24)
πGreek(30)
½Fractions(6)
●Geometric(7)
æLatin Special(8)
Click any entity card to copy it in your chosen format. All data is embedded in the page and works offline.
Related HTML entities
All html entities →Delta (δ) in HTML
The Greek letter delta at U+0394 and U+03B4, its entity forms, the increment sign that looks identical, and what a capital delta asserts about a quantity.
Beta (β) in HTML
The Greek letter beta at U+0392 and U+03B2, its entity forms, its meanings in regression and finance, and the German eszett it is mistaken for.
Phi (φ) in HTML
The Greek letter phi at U+03A6 and U+03C6, its entity forms, the loopy and straight glyph variants, and the golden ratio it conventionally names.
Epsilon (ε) in HTML
The Greek letter epsilon at U+0395 and U+03B5, its entity forms, the lunate variant, and what machine epsilon means in floating point comparison.
Theta (θ) in HTML
The Greek letter theta at U+0398 and U+03B8, its entity forms, its role as the default angle variable, and what big theta asserts about an algorithm.
Lambda (λ) in HTML
The Greek letter lambda at U+039B and U+03BB, its entity forms, its use for wavelength and decay, and where the anonymous function name came from.
Tools for this
- HTML Entity Reference Free online HTML entity reference - search and copy HTML entities with live preview
- HTML Entity Encoder Free online HTML entity encoder - encode or decode HTML entities to prevent XSS and display issues