Skip to main content

Comic panel sidecar format and tools (detect, reader, editor)

Project description

cbxy

cbxy is a sidecar format for comic panel geometry.

A Brief Introduction

A .cbxy file is a ZIP archive of JSON files (same idea as CBZ, but metadata instead of images).

There is no manifest. Each entry uses the same relative path as the comic page, with a .json suffix:

book.cbz                         book.cbxy
├── page-001.jpg                 ├── page-001.json
├── page-002.jpg                 ├── page-002.json
└── Art/page-003.png             └── Art/page-003.json

Page JSON

Coordinates are normalized fractions of the page (0–1), so they survive resize. Array order is reading order.

{
  "page": "page-001.jpg",
  "width": 1680,
  "height": 2583,
  "panels": [
    { "x": 0.035, "y": 0.058, "w": 0.388, "h": 0.286 },
    { "x": 0.437, "y": 0.058, "w": 0.526, "h": 0.287 }
  ]
}

For a full specification, see the cbxy format spec.

About This Repository

This repository is a Python reference implementation of the cbxy format and tools. It is meant to be a showcase for the format and tools.

Installation

Install using pip:

pip install cbxy

or uv:

uv tool install cbxy

Tools

Once installed, three command-line tools are available:

  • cbxy-detect: Detects panels in a comic and writes a .cbxy sidecar beside it.
  • cbxy-reader: Opens a comic in the browser with optional guided panel view.
  • cbxy-editor: Visual editor for creating or fixing panel boxes.

cbxy-detect

Detects panels in a comic archive and writes a .cbxy sidecar next to it (OpenCV by default, with ML fallback for irregular layouts).

cbxy-detect path/to/book.cbz
Argument Description
comic Path to a .cbz, .cbr, image folder, or single page image
-o, --out Output .cbxy path (default: same stem beside the comic)
--engine auto|cv|ml Detection backend (default: auto)
--min-area Minimum panel area as a fraction of the page (default: 0.03)
--gutter Near-white gutter threshold for CV, 0–255 (default: 230)
--conf ML confidence threshold (default: 0.25)
--limit Only process the first N pages
--preview-dir Write annotated preview JPEGs into this folder

Engines

--engine chooses how panels are found. Most of the time auto is enough; pick cv or ml when you know the page style.

Engine When to use
auto (default) Best general choice: tries OpenCV first, falls back to ML when a page looks irregular (e.g. one huge “panel”)
cv Traditional grid layouts with clear white gutters (fast, no model download)
ml Messy / borderless / overlapping layouts (Image-style pages, splash + insets)

The ML path uses Ultralytics YOLO with the pretrained comic-panel weights mosesb/best-comic-panel-detection (downloaded on first ML run).

cbxy-reader

cbxy-reader guided view

Opens a comic in the browser. If a sibling .cbxy is present, supports guided panel-by-panel view; otherwise pages only.

cbxy-reader path/to/book.cbz
Argument Description
comic Path to a .cbz, .cbr, image folder, or single page image
--host Bind address (default: 127.0.0.1)
--port Port (default: 8765)
--no-open Do not open a browser window automatically

cbxy-editor

cbxy-editor panel editing

Browser UI to create or edit panel boxes and save a .cbxy beside the comic.

cbxy-editor path/to/book.cbz
Argument Description
comic Path to a .cbz, .cbr, image folder, or single page image
--host Bind address (default: 127.0.0.1)
--port Port (default: 8766)
--no-open Do not open a browser window automatically

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

cbxy-0.1.1.tar.gz (564.2 kB view details)

Uploaded Source

Built Distribution

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

cbxy-0.1.1-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file cbxy-0.1.1.tar.gz.

File metadata

  • Download URL: cbxy-0.1.1.tar.gz
  • Upload date:
  • Size: 564.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cbxy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6e1bf8eaa453548441a98fab8bf9a013c6fea3c2d58463a7d070adb9b692fab2
MD5 fc6647abb511c1d1b535afafbf5bb4cb
BLAKE2b-256 cc6b73cabcbe362cdbf35c890b1b7617b87473e095a6aa74fb77948ec7506fe8

See more details on using hashes here.

File details

Details for the file cbxy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cbxy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cbxy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf1512dce1286a51a7d6bfd3d6caf45f7e2a23d233565392796eaa88be56a45f
MD5 dfeda8718942f600ef3a6822cc875cfc
BLAKE2b-256 090098a0a5f244c8da7d152ff6a4b439918cb83915f80aba98b9c34a4723d906

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