File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 5858# values A, B, C, D and arranged like so:
5959#
6060# byte 1 byte 2 byte 3 byte 4 byte 5
61- # AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD AABBCCDD
61+ # AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD DDCCBBAA
6262#
6363# Here, we convert our data into a 16-bit array, shift all values left by
6464# 2-bits and unpack the low-order bits from every 5th byte in each row,
6565# then remove the columns containing the packed bits
6666
6767data = data .astype (np .uint16 ) << 2
6868for byte in range (4 ):
69- data [:, byte ::5 ] |= ((data [:, 4 ::5 ] >> (( 4 - byte ) * 2 )) & 0b11 )
69+ data [:, byte ::5 ] |= ((data [:, 4 ::5 ] >> (byte * 2 )) & 0b11 )
7070data = np .delete (data , np .s_ [4 ::5 ], 1 )
7171
7272# Now to split the data up into its red, green, and blue components. The
You can’t perform that action at this time.
0 commit comments