Created
February 11, 2023 14:38
-
-
Save jamesoff/9dab11cc377e4504e8dc87d1ab47c333 to your computer and use it in GitHub Desktop.
Hacked-together code to read an IRG file's image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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