A Python library for creating manhwa-style speech bubbles and narration boxes using PIL (Pillow).
- Speech Bubbles: Multiple bubble types including oval, rectangular, cloud (thought), jagged (shouting), wavy (nervous), black (dark/evil), heart (romantic), spiky (rage), glow (magic/divine), and scratchy (madness/creepy)
- Narration Boxes: Various narrator styles including plain, borderless, dashed, dark, and wavy borders
- Customizable: Adjustable positioning, sizing, and tail directions
- Easy to Use: Simple API with clear function signatures
git clone <your-repo-url>
cd bubble
pip install -e .pip install manhwa-bubblesfrom PIL import Image, ImageDraw
from manhwa_bubbles import speech_bubble, narrator_plain
# Create a canvas
img = Image.new("RGB", (800, 600), "lightblue")
draw = ImageDraw.Draw(img)
# Add speech bubble
speech_bubble(draw, (50, 50, 200, 100), "Hello world!", "oval")
# Add narration
narrator_plain(draw, (300, 50, 250, 80), "The story begins...")
# Save or display
img.save("comic_panel.png")
img.show()| Type | Description | Use Case |
|---|---|---|
oval |
Standard oval speech bubble | Normal dialogue |
rect |
Rectangular bubble | Narration |
cloud |
Cloud-like thought bubble | Internal thoughts |
jagged |
Spiky/jagged edges | Shouting, anger |
wavy |
Wavy borders | Nervous, shaky speech |
black |
Black bubble with white text | Evil, dark thoughts |
heart |
Heart-shaped bubble | Romantic dialogue |
spiky |
Flame-like spiky edges | Rage, intense anger |
glow |
Bubble with glowing aura | Magic, divine speech |
scratchy |
Rough, scratchy borders | Madness, creepy thoughts |
| Type | Description | Use Case |
|---|---|---|
narrator_plain |
Simple rectangular box | Standard narration |
narrator_borderless |
Text only, no border | Floating text |
narrator_dashed |
Dashed border | Flashbacks, memories |
narrator_dark |
Black box with white text | Ominous narration |
narrator_wavy |
Wavy borders | Dream sequences |
Creates a speech bubble with the specified style.
Parameters:
draw: PIL ImageDraw objectxy: Tuple of (x, y, width, height) for bubble position and sizetext: Text to display in the bubblebubble_type: Type of bubble ("oval", "rect", "cloud", "jagged", "wavy", "black", "heart", "spiky", "glow", "scratchy")tail_dir: Direction for speech tail ("down", "up", "left", "right")
Creates narration boxes with different styles.
Parameters:
draw: PIL ImageDraw objectxy: Tuple of (x, y, width, height) for box position and sizetext: Text to display
See examples/demo.py for comprehensive usage examples.
- Python 3.6+
- Pillow (PIL) 8.0.0+
MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.