```import math
from PIL import Image

img = Image.open("/Volumes/Dean/My Code/Spectrum/Z80/Graphics/aircraft.png")

width, height = img.size

spriteName = "Sprite_Aircraft"
autoShift = 2

byteWidth = int(width / 8) + addMask
autoShiftLoop = int(8 / autoShift) if autoShift > 0 else 0
autoShiftByte = int(2 ** autoShift - 1) << (byteWidth * 8 - autoShift)

print("Image Width:", width)
print("Image Height:", height)
print("Byte Width::", byteWidth)
print("Auto Shift: ", autoShift, autoShiftLoop)
print("Data:\n")

dataArray = []

for y in range(0, height):
data = 0b0
for x in range(0, width):
r, g, b, a = px[x, y]
bit = 1 << (width - x - 1)
if a == 255: data |= bit
if a == 128: mask |= bit

data = data << 8
mask = mask << 8 | 0xFF

for j in range(0, autoShiftLoop):
label = "{:s}_{:d}:\t".format(spriteName, j * autoShift)
for row in dataArray:
print(label, end = "")
label = "\t\t\t"
prefix = "DB "
for i in reversed(range(0, byteWidth)):
s = i * 8
m = 0xFF << s
b1 = (row[1] & m) >> s # Mask
b2 = (row[0] & m) >> s # Sprite
print("{:s}%{:08b}, %{:08b}".format(prefix, b1, b2), end = "")
prefix = ", "
print("")
row[0] = row[0] >> autoShift
row[1] = row[1] >> autoShift | autoShiftByte
print("")

```