Skip to content

Alterkai/chapter-splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Simple Chapter Splitter

A Python tool for splitting manga volume pages into separate chapter folders based on table of contents page numbers.

Purpose

When scanning or downloading manga volumes, all pages come in a single folder. This tool helps organize them into individual chapter folders by using the table of contents (ToC) page numbers as reference.

Features

  • Single volume mode - Process one volume at a time
  • Batch mode - Process multiple volumes of a series with continuous chapter numbering
  • Auto-detection - Automatically finds volume folders matching Volume X / Vol X pattern
  • Offset calculation - Calculates difference between ToC page numbers and actual filenames
  • Visual preview - Generates a grid image of chapter covers for verification before splitting
  • Sequential renaming - Optionally renames files to sequential numbers within each chapter
  • Safe operation - Copies files instead of moving them, preserving originals

Requirements

pip install Pillow

Usage

python split_chapters.py <manga_folder>

Mode Selection

On startup, choose between:

  • Mode 1 - Single volume processing
  • Mode 2 - Batch processing (multiple volumes)

Single Volume Mode

python split_chapters.py "D:/Manga/One Piece/Vol 1"

Prompts:

  1. Chapter starting pages - Comma-separated page numbers from the ToC
    • Supports ranges: 1,15-20,30
  2. First chapter filename - The actual filename of the first chapter's first page (e.g., 005.png)
  3. First chapter number - The chapter number to start from (e.g., 1)
  4. Sequential rename - Choose to rename files sequentially or keep original names

Output:

Vol 1/
  001/    # Chapter 1
    001.png
    002.png
    ...
  002/    # Chapter 2
    001.png
    002.png
    ...

Batch Mode

python split_chapters.py "D:/Manga/One Piece"

Expected folder structure:

One Piece/
  Volume 1/
  Volume 2/
  Volume 3/

Prompts:

  1. First chapter number - Starting chapter for the entire series (e.g., 1)
  2. Per-volume prompts - For each volume:
    • Chapter starting pages from ToC
    • First chapter filename
    • Sequential rename option

Output:

One Piece/
  Volume 1/     # source (unchanged)
  Volume 2/     # source (unchanged)
  chapters/     # output (new)
    001/        # Vol 1, Ch.1
    002/        # Vol 1, Ch.2
    ...
    011/        # Vol 2, Ch.11
    012/        # Vol 2, Ch.12
    ...

Chapter numbering continues across volumes automatically.


How Offset Works

ToC pages typically start from page 1 (cover, credits, etc.), but actual filenames may differ:

ToC Page Actual Filename Offset
1 001.png 0
3 005.png 2

The tool calculates this automatically when you provide the first chapter's filename.

Supported Image Formats

PNG, JPG, JPEG, WebP, BMP, GIF

About

A Python tool for splitting manga volume pages into separate chapter folders based on table of contents page numbers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages