Skip to content

Instantly share code, notes, and snippets.

@mateusdcc
Created June 8, 2025 19:19
Show Gist options
  • Save mateusdcc/5700fb34cd74424e748d006da13724a0 to your computer and use it in GitHub Desktop.
Save mateusdcc/5700fb34cd74424e748d006da13724a0 to your computer and use it in GitHub Desktop.
Code to decode images from the roblox showcase game of a working photo shooting camera by NickWaterBr. Written on a jupyter notebook
from PIL import Image
from IPython.display import display
encoded_image = "REPLACE WITH UR IMAGE EXPORT"
def decode_hex_image(hex_str: str, width: int, height: int) -> Image.Image:
hex_str = hex_str.strip()
expected_len = width * height * 6
img = Image.new("RGB", (width, height))
pixels = img.load()
idx = 0
for y in range(height):
for x in range(width):
triplet = hex_str[idx:idx+6]
r, g, b = bytes.fromhex(triplet)
pixels[x, y] = (r, g, b)
idx += 6
return img
img = decode_hex_image(encoded_image, 64, 36)
display(img)
img.save("decoded_image.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment