Ticket #1761: testtransp.py

File testtransp.py, 291 bytes (added by Tom Goddard, 7 years ago)

Python script to compute predicted brightness for alpha-blending with various framebuffer bit depths.

Line 
1n = 99
2#n = 49
3g = 0
4#b = 128
5b = 102
6#a = 3
7#a = 7
8a = 2
9#a = 5
10c = g
11for i in range(n):
12 c = (a/255)*b + (1-a/255)*c
13# c = int(c)
14# c = int(c*16)/16
15 c = round(c*16)/16
16# c = int(c*256)/256
17# c = int(c*4)/4
18# c = round(c)
19print('c', c, 'n', n, 'b', b, 'g', g, 'a', a)