Skip to content

LiteralGenie/ScriptToBubble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(WIP) Automatically typeset a text script onto a set of comic pages.

Setup

Requires Python 3.8+. See /examples/ for usage.

  1. git clone https://github.com/LiteralGenie/ScriptToBubble/
  2. cd ScriptToBubble
  3. git submodule init
  4. git submodule update
  5. python -m pip install -r requirements.txt
  6. python -m nltk.downloader all

Typesetting Process

  1. Segment panels by identifying contours.
    example (from /examples/3_panel_segmentation/) From left-to-right:
    • Original image
    • After thresholding
    • After contour filtering (based on size, parent contours, etc)
    • After point clustering
    • Concavity identification
    • After concavity removal
    • Convex hull (reudces number of points)
    • Shrink any overlapping contours
  2. (todo) Identify panel ordering.
  3. Segment speech bubbles via Mask-RCNN.
  4. (todo) Identify speech bubble ordering.
  5. Identify best text placement and shaping.
    • The "shape" of a paragraph refers to the position of the line-breaks. Possible line break insertion points are determined by identifying clause boundaries and certain part-of-speech tags for each word / phrase.
    • The score for a given position / shaping is calculated using rays that extend from the edges of the text (example). Currently, the position / shaping that gives the most balanced ray distributions vertically / horizontally is assigned the best score.
    example (from /examples/2_text_centering/)
    left: Text auto-centered and with line-breaks auto-inserted
    right: Heatmap of scores for each center location (with the text shape shown on left)

Todo

  1. Unmerge panels that are bridged by speech bubble. (Split contour by concave vertices and regroup vertices.)
  2. Infer panel ordering.
  3. Train bubble detection model (use segmented panels)
  4. GUI
  5. Redo prop caching
  6. Shaping with hypenation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages