A Python3/Python Turtle program that takes raster image data values from any image and renders the image in black-and-white, pseudocolor, and grayscale dots.
This program first uses a function to get raster values from any image. Then, it takes that data and makes a sublist of values from each block of pixels by separating the blocks into rows and columns. The average pixel value is calculated from the block sublist. The average pixel value is then converted to a circle radius by dividing the block size in half. The program scans through the image data block by block and represents each with a circle depending on render style.
The example image (file.png
) is uploaded as a test image for the program (credit: University of South Florida).
Upload your own file by replacing image_path = "file.png"
with the file path to your image.
I made this as an experimental tool to render important image information with the least amount of detail. It's fascinating to see what information our eyes and brain need to understand what an image is trying to convey.
The grayscale mode reveals the depth of the image. Seeing an image in pseudocolor can help with understanding lighting, especially within low-light images (think of a heat signature). Black-and-white rendering can help with identifying silhouettes. Different rendering sizes help with interpreting how much detail is needed to see information in an image.
This is also important to learn when creating art. I aim to improve this program to become a tool (a helping eye) for artists — since it reduces the image to barebones information, this program can help artists understand what information is important when they look at reference images.