dariusk / NaNoGenMo-2014

National Novel Generation Month, 2014 edition.
257 stars 17 forks source link

An image is worth a thousand words #69

Open StreetWanderer opened 9 years ago

StreetWanderer commented 9 years ago

Or at least that's what they say. Let see where I can go with converting an image to a novel.

StreetWanderer commented 9 years ago

Just a funny snippet of a bogus result I got : "Nays nays nays." (Note that I'm working with a Nyan Cat image for now)

Does any of you have a Python-friendly spellchecker ? I'm using PyEnchant but it feel kind of dumb.

StreetWanderer commented 9 years ago

Well. I'm 1 day late for posting but here is all I got : The Novel

The Code

hugovk commented 9 years ago

Aaa maya. Aaa maya say nay. Nay nada.

Nay a maya nay a nay nays nays. Yancy.

MichaelPaulukonis commented 9 years ago

Could you explain your method a bit more?

StreetWanderer commented 9 years ago

Yes! Sorry I pushed all of that in the middle of a rush.

Basically the script takes an image file, extract CMYK color for each pixel and convert that into words using a dictionary.

I also updated the Readme with more details.

MichaelPaulukonis commented 9 years ago

Okay, I get it know. It was making me think of strung-out DNA words.

I like the end result. This is an unusual sourcing strategy. Not one that can be well-adapted for coherence, but that's not a concern.

Although I wonder if it would be possible to steganographically encode an image that this algo could then turn into a coherent text.....

StreetWanderer commented 9 years ago

Thinking about your steganography idea I did a quick and dirty thing that take a text file and create an image file with it. I also added the function to get the text back from the image. https://github.com/StreetWanderer/LazyStegano