Skip to main content

Raw-style comic stage renderer — parses ComicDirector ML XML and outputs video

Project description

RawStage

ComicDirector ML v1.0 rendering engine. Parses XML performance instructions and outputs MP4 video by compositing PNG character sprites and backgrounds.

Install

pip install -e .

Requires ffmpeg on PATH for video encoding.

Quick start

# Render a single frame at a given time
rawstage frame scene.xml --assets ./assets/ --time 3.0 --output frame.png

# Render a full PNG frame sequence for a scene
rawstage animate scene.xml --assets ./assets/ --fps 24 --output frames/

# Render a complete script to MP4
rawstage render script.xml --assets ./assets/ --output out.mp4 --fps 24

Supported XML events

Event Attributes
enter character, method (fade_in/slide_*/pop_in), target_x, target_y, start, duration
exit character, method (fade_out/slide_*), start, duration
move character, to_x, to_y, path (waypoints), easing, start, duration
camera target (character), center_x, center_y, scale, easing, start, duration
dialogue character, text, start, duration, font, font_size, color, outline_width, outline_color, <span> children
expression character, set (expression asset id), start
audio ref, action (play/play_once), loop, volume, start
transition type (fade/dissolve/wipe_left/wipe_right), duration

Subtitle styling

<dialogue> supports two forms:

Plain text (backward compatible) — all text in a single text attribute:

<dialogue character="alice" start="4.5" duration="2.5"
          text="你好,今天天气真好!" />

Rich text — use <span> children for mixed styles within one subtitle line:

<dialogue character="alice" start="3.0" duration="3.0"
          font_size="48" color="#FFFFFF"
          outline_width="2" outline_color="#333333">
  <span color="#00FF00" italic="true">绿色斜体,</span>
  <span color="#FF0000" underline="true" bold="true">红色粗体下划线</span>
</dialogue>

Dialogue-level attributes serve as defaults for all spans:

Attribute Default Description
font (system CJK font) Font file path
font_size 40 Default font size in pixels
color #FFFFFF Default text color (hex RGB / RGBA)
outline_width 3 Outline thickness in pixels
outline_color #000000 Outline color (hex RGB / RGBA)

Each <span> can override:

Attribute Description
color Text color (hex, e.g. #FF0000)
size Font size override
italic "true" / "false"
underline "true" / "false"
bold "true" / "false"
font Font file path override

Spans are concatenated horizontally with baseline alignment. If no <span> children are present, the text attribute is rendered as a single span using dialogue-level defaults.

Key design decisions

  • 1920×1080 canvas with unified coordinate system. Character anchor: bottom-center.
  • Absolute timeline per scene (starts at 0s). All events use start (seconds) + duration.
  • Camera: viewport defined by center_x, center_y + scale (1.0 = full canvas).
  • Character z-sort: by canvas y (higher = closer). Stable during camera zooms.
  • Quadratic easing — half the multiplies of cubic, negligible visual difference.
  • Write-then-encode — never holds more than one frame in memory.
  • No numpy — Pillow + math covers all needs.

Running tests

pytest tests/ -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rawstage-0.1.0.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rawstage-0.1.0-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

Details for the file rawstage-0.1.0.tar.gz.

File metadata

  • Download URL: rawstage-0.1.0.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for rawstage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 660eb24ac1d6db2b1478233f0bd2075492e16956be54f46f4b05e4d63daa82c5
MD5 5687827eb54f6a38a3d64d6730647413
BLAKE2b-256 d0d014a63045b932d11142ad593de162f1790891f19f8e7157351120ad72f099

See more details on using hashes here.

File details

Details for the file rawstage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rawstage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for rawstage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ac6ccdd59102b944097b36eb7c9d854306c8ed43823f4156273d23db4c2e875
MD5 8639c92b99758fe51cf21eea200b80a6
BLAKE2b-256 ae89fe917e08ecc28a1decc4b5e548cc89c85c1fad59b073d55eb58150078b06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page