Question Details

No question body available.

Tags

colors bitmap mask alpha rgba

Answers (1)

February 15, 2026 Score: 0 Rep: 21 Quality: Low Completeness: 60%

Apologies for wasting people's time, I managed to measure alpha through an unorthodox method.

I've calculated the formular for alpha to be:

Color brightness = ((((255 * MV) 1

Amazingly, for bit masks which produce 255 as the maximum (4-bit and up), this formular produces almost identical values for alpha. For ones that do not produce 255 (1-bit = 192, 2-bit = 240, 3-bit = 252) this formular produces different values which ensure a maximum of 255.

Here are the results produced by both formulae (top RGB, bottom Alpha):

1-bit

  0 192
  0 255

2-bit

  0  80 160 240
  0  85 170 255

3-bit

  0  36  72 108 144 180 216 252
  0  36  73 109 146 182 219 255

4-bit

  0  17  34  51  68  85 102 119 136 153 170 187 204 221 238 255
  0  17  34  51  68  85 102 119 136 153 170 187 204 221 238 255

5-bit

  0   8  16  24  33  41  49  57  66  74  82  90  99 107 115 123
132 140 148 156 165 173 181 189 198 206 214 222 231 239 247 255
  0   8  16  25  33  41  49  58  66  74  82  90  99 107 115 123
132 140 148 156 165 173 181 189 197 206 214 222 230 239 247 255

I won't go up to 8-bit, but you get the point.

Alpha can't be measured directly, its effects are on the colors. I generated a solid white image with gradual low to high alpha at different color mask bit depths, and overlayed it on top of a solid black image with no alpha. Saving it as a non-alpha image (24-bit) exposed the alpha in the RGB slots.