2017 icon indicating copy to clipboard operation
2017 copied to clipboard

Some kind of comic book

Open enkiv2 opened this issue 6 years ago • 9 comments

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 (https://github.com/dariusk/NaNoGenMo-2014/issues/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 avatar Nov 01 '17 14:11 enkiv2

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 avatar Nov 01 '17 17:11 enkiv2

Image comparisons: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/denpa-onna-to-seishun-otoko-comparison.png https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/PrinceofDarkness-comparison.png

enkiv2 avatar Nov 01 '17 17:11 enkiv2

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 avatar Nov 01 '17 18:11 enkiv2

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

enkiv2 avatar Nov 02 '17 12:11 enkiv2

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

enkiv2 avatar Nov 02 '17 16:11 enkiv2

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.

ghost avatar Nov 02 '17 23:11 ghost

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

kamn avatar Nov 03 '17 03:11 kamn

Generative Detective, from a couple years ago, was a lot more choosy about both text & images in ways that almost required a human in the loop. But, I think this is evidence that you can get pretty close with totally random images and juxtapositions, with the right source text.

I didn't really use an appropriate source text, though -- I should have cleaned it up and removed copyright notices and such. Shorter, pre-vetted lines, even in totally random order, make for more striking juxtapositions: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/holzercomic.pdf

I might try again with Vonnegut source text & one sentence per line. I expected Raymond Chandler to write a lot of short sentences, but the average length is a lot longer than I expected here.

On Thu, Nov 2, 2017 at 11:48 PM Samuel Miller [email protected] wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NaNoGenMo/2017/issues/54#issuecomment-341617255, or mute the thread https://github.com/notifications/unsubscribe-auth/AAd6GTvWvXyLQzVci90CYxtqDUho6cMrks5syoz8gaJpZM4QOQv1 .

enkiv2 avatar Nov 03 '17 11:11 enkiv2

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

enkiv2 avatar Jul 02 '18 15:07 enkiv2