Skip to content

Instantly share code, notes, and snippets.

@jamesoff
Created February 11, 2023 14:38
Show Gist options
  • Save jamesoff/9dab11cc377e4504e8dc87d1ab47c333 to your computer and use it in GitHub Desktop.
Save jamesoff/9dab11cc377e4504e8dc87d1ab47c333 to your computer and use it in GitHub Desktop.
Hacked-together code to read an IRG file's image
from PIL import Image, ImageDraw
WIDTH = 180
HEIGHT = 240
im = Image.new("L", (WIDTH, HEIGHT))
with open("230119180929.irg", "rb") as in_file:
in_file.seek(0x7E)
draw = ImageDraw.Draw(im)
y = 0
while y < HEIGHT:
x = 0
line_bytes = in_file.read(WIDTH)
for byte in line_bytes:
draw.point((x, y), byte)
x += 1
y += 1
im.save("output.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment