       index = lookupValue | <span class="number">0</span>

        <span class="keyword">if</span> index <span class="keyword">is</span> currentIndex
          blend = <span class="number">256.0</span> * (lookupValue - (lookupValue | <span class="number">0</span>))
          iblend = <span class="number">256</span> - blend
        
          imagePixels[idx] = (imagePixels[idx] * iblend + pixels[idx] * blend) &gt;&gt; <span class="number">8</span>
          imagePixels[idx + <span class="number">1</span>] 