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

Some kind of comic book #54

Open
enkiv2 opened this issue Nov 1, 2017 · 9 comments
Open

Some kind of comic book #54

enkiv2 opened this issue Nov 1, 2017 · 9 comments
Labels
completed For completed novels!

Comments

@enkiv2
Copy link

enkiv2 commented Nov 1, 2017

Since it's been a day since NaNoGenMo started & I've already done three, I feel pretty confident about doing something more involved.

Back in 2014, Generative Detective (dariusk/NaNoGenMo-2014#70) showed that comics were possible (and that people are a little more forgiving of what looks like a moody experimental comic than they might be of a novel).

Earlier this summer, I worked on a bot that does a substantial amount of the same kind of processing that Generative Detective needed to do, and in the process demonstrated that the juxtaposition of text and image was often striking even when the image was completely random, so long as both the text and the image were striking on their own: https://github.com/enkiv2/misc/blob/master/barbara_holzer.py

So, I plan to take advantage of my phrase-chain code (https://github.com/enkiv2/misc/tree/master/phrasechain) to generate sentences of text from some input, then superimpose that text on paneled pages, where the panels are random images that I downloaded modified to look like line drawings.

Much as modern comics often don't limit the text to within a panel, I also won't bother: I figure alignment by itself will do enough, for short phrases. I'll select some input corpus that's heavy on short sentences. (I've got some noir around, and some vonnegut.)

Figuring out how to do panel layout with arbitrary images will be the big challenge. I'm thinking I'll start by aligning along the top or left edge, depending upon the panel's aspect ratio in comparison to that of the page, then do the same with the leftover space recursively until less than 1/4th of the page's space is empty, scaling images down so that they fit and adding a border.

Another possible stylistic flourish (which is pretty common in manga): have the first few pages be in color (ex., by posterizing the existing full-color images to four colors) and the rest be in black and white.

PIL has edge detection, so I think that (like Generated Detective) I'll apply that edge detection to the original image and either overlay or replace the image with it.

@enkiv2
Copy link
Author

enkiv2 commented Nov 1, 2017

First step is a filter that makes photos and other images look like sketches: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/sketchify.py

If colorize is set to False, you get a greyscale shaded version (like soft pencils were used to shade an ink sketch). If it's set to True, you get something that looks like watercolor has been used to color in an ink sketch. If you set sketchOnly to true, you drop all the shading.

@enkiv2
Copy link
Author

enkiv2 commented Nov 1, 2017

Now I have some panel layout logic: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/panel_layout.py

Basically, I align to a bounding box on the top-left, resize (keeping aspect ratio) to fit inside, and if the image is within two border-widths or 20% of filling on some dimension then I zoom-and-crop to fit along that dimension. If not, I take the leftover boxes (one if we only don't fit along one dimension, and three if we don't fit along both X and Y) and pass them back into the algorithm to be filled.

The images are "panelified" -- i.e., sketchified and given a gutter around them -- before being put on the page.

Example layout: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/panel-layout-test.png

@enkiv2
Copy link
Author

enkiv2 commented Nov 2, 2017

Completed 101-page comic: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/comic.pdf

@hugovk hugovk added the completed For completed novels! label Nov 2, 2017
@enkiv2
Copy link
Author

enkiv2 commented Nov 2, 2017

Reader review: "It feels like someone injected laundry detergent into my eyes and forced me to scroll through Google Image Search"

@ghost
Copy link

ghost commented Nov 2, 2017

I flicked through the comic, and I have to say selection of images and filters makes it rather spooky and unsettling at times, good job.

@kamn
Copy link

kamn commented Nov 3, 2017

Very cool! I think images could go a long way in making something more 'readable'.

@enkiv2
Copy link
Author

enkiv2 commented Nov 3, 2017 via email

@enkiv2
Copy link
Author

enkiv2 commented Jul 2, 2018

I wrote up an extensive post-mortem on this project here: https://medium.com/@enkiv2/fiction-generator-post-mortem-comic-book-generation-9df847dd4ada

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