Changeset 1975 for www


Ignore:
Timestamp:
Nov 16, 2007, 2:34:32 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Finished gamma correction section.
Location:
www/study
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • www/study/part4.html

    r1972 r1975  
    9696
    9797<p> The following figure shows the gamma curve for the naïve three-colour
    98 grayscale gradient we saw above (red) compared to the two-colour gradient
    99 (blue). Two major observations can be made: the new curve is far closer to
    100 a perfect, linear gradient, and there is a singularity in the middle of
    101 the curve, meaning a break in the gradient’s smoothness. </p>
     98grayscale gradient we saw above (red curve) compared to the two-colour
     99gradient (blue curve). Two major observations can be made: the new curve is
     100far closer to a perfect, linear gradient, but there is a singularity in the
     101middle of the curve, meaning a break in the gradient’s smoothness. </p>
    102102
    103103<p style="text-align: center;">
     
    114114       is fixed. </li>
    115115  <li> Don’t place the gray value at the middle of the gradient, for instance
    116        putting it around 25% itensity will again match the previous two-colour
     116       a value of around 25% intensity will again match the previous two-colour
    117117       gradients. </li>
    118118  <li> <b>Gamma-correct</b> input pixels before assigning them an output
    119        value. This ensures that the resulting gradient is perfectly linear.
     119       value. This ensures that the resulting gradient is perfectly linear
     120       and has no singularity.
    120121       </li>
    121122</ul>
     
    123124<h3> 4.2. Gamma correction </h3>
    124125
    125 <p> These are the results of gamma-correcting input pixels before doing
     126<p> Gamma correction consists in converting pixel values into intensity values
     127before performing operations on them, then reconverting them to pixel values
     128before displaying them. The exact same algorithms can be used, they just
     129operate on slightly different data. </p>
     130
     131<p style="text-align: center;">
     132  <img src="fig4-1-3.png" width="460" height="256" alt="3-colour gamma coorection" />
     133</p>
     134
     135<p> Here are the results of gamma-correcting input pixels before doing
    126136any computation on them, then using Floyd-Steinberg error diffusion: </p>
    127137
     
    137147</p>
    138148
    139 <!--
    140 <p> So, instead of using 25%, 50% and 75% patterns (which give non-uniform
    141 gray values of 0.53, 0.73 and 0.88), one should rather use 6.25%, 25% and 50%
    142 patterns, which give the better spread gray values of 0.28, 0.53 and 0.73
    143 and result in far more accurate gradients. This is especially obvious when
    144 observing the high intensity drop between the 25% pattern and black (top row):
    145 </p>
    146 
    147 <p style="text-align: center;">
    148   <img src="pat005.png" width="400" height="240"
    149        class="inline" alt="better gradients" />
    150 </p>
    151 
    152 <p> Here is the result on Lenna. As you can see, the result is visually less
    153 appealing than with the “incorrect” colours. But when seen from a distance,
    154 there is no doubt this version is more accurate: </p>
    155 
    156 <p style="text-align: center;">
    157   <img src="out007.png" width="256" height="256"
    158        class="inline" alt="gamma-aware 3-pattern halftoning" />
    159   <img src="grad007.png" width="32" height="256"
    160        class="inline" alt="gamma-aware 3-pattern halftoning gradient" />
    161 </p>
    162 -->
    163 
    164 <!--
    165 <h3> Gamma with more gray levels </h3>
    166 
    167 <p> As seen previously, the smoothest dithering pattern that can be created
    168 with black and white is by uniformly alterning the two colours. However, the
    169 resulting colour (0.73) it is not evenly situated on the gray scale. </p>
    170 
    171   <img src="out008.png" width="256" height="256"
    172        class="inline" alt="gamma-aware 6.25%, 25% and 50% halftoning" />
    173 
    174 <p> Here is the application to Lenna, using the 0-0.2, 0.2-0.4, 0.4-0.6,
    175 0.6-0.8 and 0.8-1 ranges for black, white and the three patterns: </p>
    176 
    177 <p style="text-align: center;">
    178   <img src="out005.png" width="256" height="256"
    179        class="inline" alt="20/40/60/80% threshold and 25/50/75% halftones" />
    180 </p>
    181 -->
     149<p> Two-colour dithering is not visually satisfying: dark areas lack much
     150detail because the gamma curve is very flat at low intensities. However,
     151the result itself is far more accurate that previously. The problem, while
     152still visible, is even less important with three-colour dithering: the image
     153on the right is superior to what The Gimp or Adobe Photoshop are able to
     154come up with. </p>
    182155
    183156<div style="float: left;">
Note: See TracChangeset for help on using the changeset viewer.