I promise this is relevant to 3D somehow :D Sorry, you do need to get the raw binary code off of a png file for this to work. Anything else WILL (probably) cause an ungodly amount of lag, and no image. I have a sample 5x5 image preset in the project All code was written by me, except for the python script in "notes and credits", which was AI generated :D
Thanks to @Destructor_chess for testing my parser If you guys want to try parsing your own PNG's, you'll need to get your hands on the raw binary file. Once you have this, click the green flag + up arrow, and paste the code in. Big PNG's may not work on scratch due to list size limits I used this python code here: (On the last line, replace fileName with your PNG name. The PNG must be stored in downloads.) Since I don't want to be accused of sending a virus over, please check the code yourselves before using it :) from pathlib import Path def read_binary_from_downloads(filename: str): downloads = Path.home() / "Downloads" file_path = downloads / filename if not file_path.exists(): raise FileNotFoundError(f"Can't find {file_path}. It probably ran away.") with open(file_path, "rb") as f: data = f.read() bitstream = ''.join(format(byte, '08b') for byte in data) return bitstream print(read_binary_from_downloads("FileName.png"))