Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Picture is Worth N Words #121

Open
jordanfb opened this issue Nov 28, 2017 · 1 comment
Open

A Picture is Worth N Words #121

jordanfb opened this issue Nov 28, 2017 · 1 comment
Labels
completed For completed novels!

Comments

@jordanfb
Copy link

jordanfb commented Nov 28, 2017

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

@hugovk hugovk added the completed For completed novels! label Nov 28, 2017
@greg-kennedy
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed For completed novels!
Projects
None yet
Development

No branches or pull requests

3 participants