(WIP) Automatically typeset a text script onto a set of comic pages.
Requires Python 3.8+. See /examples/
for usage.
git clone https://github.com/LiteralGenie/ScriptToBubble/
cd ScriptToBubble
git submodule init
git submodule update
python -m pip install -r requirements.txt
python -m nltk.downloader all
- 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
- (todo) Identify panel ordering.
- Segment speech bubbles via Mask-RCNN.
- (todo) Identify speech bubble ordering.
- 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.
Unmerge panels that are bridged by speech bubble. (Split contour by concave vertices and regroup vertices.)- Infer panel ordering.
- Train bubble detection model (use segmented panels)
- GUI
- Redo prop caching
- Shaping with hypenation.