own associated alpha. This representation is useful for avoiding color from
empty pixels bleeding into surroundings. It is also able to represent emittance
in addition to opacity.
-Babl uses <a href='SymmetricAlpha'>Symmetric alpha transformations</a> between <a href='#separate_alpha'>separate alpha</a> and associated alpha.</dd>
+Babl uses <a href='UnifiedAlpha'>Unified alpha transformations</a> between <a href='#separate_alpha'>separate alpha</a> and associated alpha.</dd>
<dt><a name='BablFish' href='#BablFish'>BablFish</a></dt>
<dt><a name='luminance' href='#luminance'>Luminance</a></dt>
<dd>The photometric measure of luminious intensity of per unit area of light. The luminance in babl is proportional to luminance - though it doesn't use the SI unit of candela per square meter.</dd>
- <dt><a name='non_associated_alpha' href='#non_associated_alpha'>Non-associated alpha</a></dt>
- <dd>deprecated term, see separate alpha</dd>
-
<dt><a name='premultiplied_alpha' href='#premultiplied_alpha'>Premultiplied alpha</a></dt>
<dd>deprecated term, see associated alpha</dd>
- <dt><a name='separate_alpha' href='#separate_alpha'>Separate alpha</a></dt>
- <dd>This representation of pixels has alpha as a fully separate component,
+ <dt><a name='straight_alpha' href='#straight_alpha'>Straight alpha</a></dt>
+ <dd>Straight or separate alpha has alpha as a fully separate component,
that can be adjusted without affecting the color.
-Babl uses <a href='SymmetricAlpha'>Symmetric alpha transformations</a> between separate and <a href='#associated_alpha'>associated alpha</a>.</dd>
+Babl uses <a href='Unifiedlpha'>symetric alpha transformations</a> between straight and <a href='#associated_alpha'>associated alpha</a>.</dd>
<dt><a name='trc' href='#trc'>TRC</a></dt>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<!-- The babl webpage is partially autogenerated
--->
-<html>
- <head>
- <title>Symmetric Alpha - babl</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <link rel="icon" href="graphics/babl-16x16.png" type="image/png" />
- <link rel="shortcut icon" href="graphics/babl-16x16.png" type="image/png" />
- <style type='text/css'>
- @import url(babl.css);
- </style>
- </head>
- <body>
-
- <div class='print'>
- <div class='print_title'>
- <h1>Babl</h1>
- </div>
- </div>
-<!--TOC-->
-
- <div class='paper'>
- <div class='content'>
-
- <h2>Symmetric transformations for floating point alpha</h2>
-
-
- <p> babl clamps the alpha used when going from separate alpha to associated
-alpha or from associated alpha to separate alpha to BABL_ALPHA_FLOOR. This
-replaces asymptotic behavior and direct precision loss of color precision when
-multiplying or dividing by alphas near 0.0 with a consistent symmetric
-transformation.</p>
-
-<p>Original intent of data as well as non-asymptotic precision loss is thus
-maintained when the processing chain might temporarily use the other alpha
-representation.</p>
-
-<pre>
- #define BABL_ALPHA_FLOOR (1.0/65536.0)
- #define BABL_ALPHA_FLOOR_F (1.0f/65536.0f)
-</pre>
-
-<p>The deviation from not clamping near 0.0 is within the quantization margin
-of 16bit integer alpha, thus no adaptations for any SIMD or and similar 8bit
-and 16bit extensions of pixel format conversions are needed.
- </p>
-
- <p>This is the clamping function in use:</p>
-<pre>
-static inline float
-babl_epsilon_for_zero_float (float value)
-{
- if (value <= BABL_ALPHA_FLOOR_F &&
- value >= -BABL_ALPHA_FLOOR_F)
- return BABL_ALPHA_FLOOR_F;
- else
- return value;
-}
-</pre>
-<p>And an example use of this clamping function that is consistent with babls behavior:</p>
-<pre>
-static inline void
-associated_to_separate_rgba (const float *associated_rgba,
- float *separate_rgba)
-{
- float alpha = associated_rgba[3];
- float clamped_alpha = babl_epsilon_for_zero_float (alpha);
- float reciprocal_alpha = 1.0f / clamped_alpha;
-
- separate_rgba[0] = associated_rgba[0] * reciprocal_alpha;
- separate_rgba[1] = associated_rgba[1] * reciprocal_alpha;
- separate_rgba[2] = associated_rgba[2] * reciprocal_alpha;
- separate_rgba[3] = alpha;
-}
-</pre>
-
-
-<p>For more detils see <a href='https://gitlab.gnome.org/GNOME/babl/commit/a4d607843d3cab18745d547fc8a46dec51dcea5e'>the commit message of the most recent refinement</a> as well as <a href='https://www.patreon.com/posts/premultiplied-in-21014115'>blog post with further background</a>.</p>
-
-
-
- <a href='graphics/index.html'><img class='BablFish' alt='/babl' title='babl' src='graphics/babl-48x48.png'/></a>
- </div>
- </div>
-
- <div class='graphic'>
- <div class='print'>
- <img src='graphics/babl-a4poster.png' alt=' '/>
- </div>
- </div>
-
- </body>
-</html>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<!-- The babl webpage is partially autogenerated
+-->
+<html>
+ <head>
+ <title>Unified Alpha - babl</title>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
+ <link rel="icon" href="graphics/babl-16x16.png" type="image/png" />
+ <link rel="shortcut icon" href="graphics/babl-16x16.png" type="image/png" />
+ <style type='text/css'>
+ @import url(babl.css);
+ </style>
+ </head>
+ <body>
+
+ <div class='print'>
+ <div class='print_title'>
+ <h1>Babl</h1>
+ </div>
+ </div>
+<!--TOC-->
+
+ <div class='paper'>
+ <div class='content'>
+
+ <h2>Symmetric transformations for floating point alpha</h2>
+
+
+ <p> babl clamps the alpha used when going from separate alpha to associated
+alpha or from associated alpha to separate alpha to BABL_ALPHA_FLOOR. This
+replaces asymptotic behavior and direct precision loss of color precision when
+multiplying or dividing by alphas near 0.0 with a consistent symmetric
+transformation.</p>
+
+<p>Original intent of data as well as non-asymptotic precision loss is thus
+maintained when the processing chain might temporarily use the other alpha
+representation.</p>
+
+<pre>
+ #define BABL_ALPHA_FLOOR (1.0/65536.0)
+ #define BABL_ALPHA_FLOOR_F (1.0f/65536.0f)
+</pre>
+
+<p>The deviation from not clamping near 0.0 is within the quantization margin
+of 16bit integer alpha, thus no adaptations for any SIMD or and similar 8bit
+and 16bit extensions of pixel format conversions are needed.
+ </p>
+
+ <p>This is the clamping function in use:</p>
+<pre>
+static inline float
+babl_epsilon_for_zero_float (float value)
+{
+ if (value <= BABL_ALPHA_FLOOR_F &&
+ value >= -BABL_ALPHA_FLOOR_F)
+ return BABL_ALPHA_FLOOR_F;
+ else
+ return value;
+}
+</pre>
+<p>And an example use of this clamping function that is consistent with babls behavior:</p>
+<pre>
+static inline void
+associated_to_separate_rgba (const float *associated_rgba,
+ float *separate_rgba)
+{
+ float alpha = associated_rgba[3];
+ float reciprocal_alpha = 1.0f / babl_epsilon_for_zero_float (alpha);
+
+ separate_rgba[0] = associated_rgba[0] * reciprocal_alpha;
+ separate_rgba[1] = associated_rgba[1] * reciprocal_alpha;
+ separate_rgba[2] = associated_rgba[2] * reciprocal_alpha;
+ separate_rgba[3] = alpha;
+}
+
+
+static inline void
+separate_to_associated_rgba (const float *separate_rgba,
+ float *associated_rgba)
+{
+ float alpha = associated_rgba[3];
+ float limited_alpha = babl_epsilon_for_zero_float (alpha);
+
+ associated_rgba[0] = separate_rgba[0] * limited_alpha;
+ associated_rgba[1] = separate_rgba[1] * limited_alpha;
+ associated_rgba[2] = separate_rgba[2] * limited_alpha;
+ associated_rgba[3] = alpha;
+}
+</pre>
+
+
+<p>For more detils see <a href='https://gitlab.gnome.org/GNOME/babl/commit/a4d607843d3cab18745d547fc8a46dec51dcea5e'>the commit message of the most recent refinement</a> as well as <a href='https://www.patreon.com/posts/premultiplied-in-21014115'>blog post with further background</a>.</p>
+
+
+
+ <a href='graphics/index.html'><img class='BablFish' alt='/babl' title='babl' src='graphics/babl-48x48.png'/></a>
+ </div>
+ </div>
+
+ <div class='graphic'>
+ <div class='print'>
+ <img src='graphics/babl-a4poster.png' alt=' '/>
+ </div>
+ </div>
+
+ </body>
+</html>
<li>Runtime profiling/validating and code-path optimizing with persistence of profiling data across runs, with caching of results.</li>
<li>Can load <a href='ColorManagement.html'>Color Spaces</a> from ICC v2 and v4 profiles containing RGB matrix + TRC and with lcms2 dependency also <a
href='CMYK.html'>CMYK</a> profiles.</li>
- <li>Uses <a href='SymmetricAlpha.html'>Symmetric Alpha</a> conversions for conversions between separate and associate alpha, avoiding loss of color fidelity due to asymptotic behavior near alpha 0.0 in floating point.</li>
+ <li>Uses <a href='UnifiedAlpha.html'>Unified Alpha</a> conversions for conversions between separate and associate alpha, avoiding loss of color fidelity due to asymptotic behavior when dividing by 0.0 in floating point.</li>
<li>Portable self contained C code working on win32, linux, bsds and mac
on 32bit and 64bit systems.</li>
<li>Stable, small API, with singleton objects returned.</li>
build_by_default: true,
)
-SymmetricAlpha_html = custom_target('SymmetricAlpha.html',
+UnifiedAlpha_html = custom_target('UnifiedAlpha.html',
input : [
- 'SymmetricAlpha-static.html',
+ 'UnifiedAlpha-static.html',
'toc',
],
- output: [ 'SymmetricAlpha.html', ],
+ output: [ 'UnifiedAlpha.html', ],
command: [
env_bin,
'cp', '@INPUT0@', '@OUTPUT@',
build_by_default: true,
)
-
run_target('push_web',
command: [
'scp', index_html, index_static_html, babl_css, scptarget,
<li><a href='Reference.html'> Reference</a></li>
<li><a href='Glossary.html'> Glossary</a></li>
<li><a href='ColorManagement.html'> Color Management</a></li>
- <li><a href='SymmetricAlpha.html'> Symmetric-Alpha</a></li>
+ <li><a href='UnifiedAlpha.html'> Unified-Alpha</a></li>
<li><a href='CMYK.html'> CMYK</a></li>
<!--<li><a href='#Background'>Background</a></li>-->
<li><a href='index.html#Usage'> Usage</a></li>