-
Notifications
You must be signed in to change notification settings - Fork 7
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
Comments
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. |
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 |
Completed 101-page comic: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/comic.pdf |
Reader review: "It feels like someone injected laundry detergent into my eyes and forced me to scroll through Google Image Search" |
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. |
Very cool! I think images could go a long way in making something more 'readable'. |
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 ***@***.***> 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
<#54 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAd6GTvWvXyLQzVci90CYxtqDUho6cMrks5syoz8gaJpZM4QOQv1>
.
|
I wrote up an extensive post-mortem on this project here: https://medium.com/@enkiv2/fiction-generator-post-mortem-comic-book-generation-9df847dd4ada |
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.
The text was updated successfully, but these errors were encountered: