Do you know jpeg and how bad it looks when compressed too much? It uses somehting called patterns to save the image and use less space. This algorithm DOES NOT replicate jpeg, but renders from a 480x360 buffer, with a depth of 5 grayscale levels. You can input your own image and try, just scan the image getting list of 172800 elements long with values from 0 to 255 and put in the prompt menu
Anyone is free to use this implementation as long as original project/author mentioned