Created
June 8, 2025 19:19
-
-
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
This file contains hidden or 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 | |
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