Reproducing images using hex values found from a desired file
Hex takes an PNG
image and a corresponding file to recreate the image by replacing all pixels with colored hex values. I wanted to put up some art for my place and thought it would be fun to blend it with a programmers prospective. The output of the file is a postscript
file.
FILE
= Anything - the program just takes the hex values from it
IMAGE
= Tried with PNG files. JPEG files should work but the algorithm takes into factor the alpha channel so all corresponding lines of code will need to be commented out
For Toon Link:
FILE
= Legend of Zelda: Breath of the Wild theme song (mp3)
For Tardis
FILE
= Doctor Who Theme song (mp3)
Within the python file are 4 globals, set these accordingly:
FONT_SIZE = 4 # Pixel size
FILE_NAME = "input.mp3" # Name of file to get hex values from
IMAGE_NAME = "input.png" # Name of image file
DATA_OFFSET = 32 # Where to start reading data from (mp3 music data starts at 32 by)
- Turtle
- Tkinter
- PIL
MIT