title: How to include alpha channel to calculate color difference with Spatial CIELAB (S-CIELAB)?
body: <p>Of course I know how to convert RGB to LAB and LAB to RGB, color difference calculation is mentioned at <a href="https://en.wikipedia.org/wiki/Color_difference" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Color_difference</a>.<br />
  However, it does not mention anything about opacity.
  I would like to know how to convert RGBA to LAB with semi-transparent, just including the opacity into the CIELAB ΔE* formula.</p>
  
  <p><strong>Original image</strong><br />
  <a href="https://i.stack.imgur.com/kKcuz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kKcuz.png" alt="Original image"></a></p>
  
  <p>Image converted to 256 colors with formula <strong>abs(R1 - R2) + abs(G1 - G2) + abs(B1 - B2) + abs(alpha1 - alpha2)</strong> as fitting function to select palette and dithering<br />
  <a href="https://i.stack.imgur.com/iz92K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iz92K.png" alt="Image converted to 256 colors by RGB"></a></p>
  
  <p>Image converted to 256 colors with formula <strong>abs(L1 - L2) + abs(a1 - a2) + abs(b1 - b2) + abs(alpha1 - alpha2)</strong> as fitting function to select palette and dithering<br />
  <a href="https://i.stack.imgur.com/Bsqd3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bsqd3.png" alt="Image converted to 256 colors by CIELab"></a></p>