NaNoGenMo / 2017

National Novel Generation Month, 2017 edition.
https://nanogenmo.github.io
185 stars 7 forks source link

A Picture is Worth N Words #121

Open jordanfb opened 6 years ago

jordanfb commented 6 years ago

I was planning on making some awesome thing with AI agents and interactions etc. but it turns out I don't have the knowledge or time. Instead I made this, whatever this is. When given an image (or it can download a random one from lorempixel.com given a size) it makes a pdf of the closest color names it can find pixel by pixel. At the end it includes three images -- the original image, the image created using the RGB values of the colors, the difference between the two in red-scale and the difference multiplied by 10. The color names are all gathered from random websites (the attribution is in the text file). The image I used for the example is a totally free use image as far as I know.

(Picture.txt should really be picture.py and is my code, but I didn't want to make a whole repository just yet and apparently you can't attach .py files) picture.py colors.txt (this is the database of colors, it's terribly formatted so I just made the code able to handle it, sorry! If you want to add more it needs the name followed by something starting with a pound symbol, followed by an RGB formatted as (r,g,b) with no spaces in between)

Here's the output novel for a free use image I downloaded and scaled down. Scaled down it's a 260x195 image and the word count is 88050 words, not counting the title or image label, so keep that in mind if you make your own novel with it. out.pdf

greg-kennedy commented 6 years ago

How fun, I like the "image processing" style entries. There was a similar entry to this from 2015, it was called The Cover of The Sun Also Rises.

The pictures at the end of your PDF really make this entry. I like being able to see the "color difference", it's really cool.