File size: 1,671 Bytes
75d5613
b96bf6b
 
 
75d5613
 
436c358
652f463
75d5613
 
 
 
b96bf6b
 
 
 
 
 
 
 
 
 
652f463
b96bf6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: Manhwa Panel Extractor
emoji: 📚
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: "5.23.3"
python_version: "3.10"
app_file: app.py
pinned: false
---

# Manhwa Panel Extractor

Scrolling through manhwa pages on your phone is a pain, there's just too much white space. Plus I sometimes like to make memes from just the image. 

![image](https://github.com/user-attachments/assets/7d1e0004-89f8-45d2-8604-7da116c3d630)


## What It Does
- **Extracts Panels**: Slices manhwa pages into individual panels.
- **Refines Them**: Removes speech bubbles using HSV magic.
- **Processes Chapter Batches**: Accepts a chapter folder upload or a ZIP of many chapter folders, then returns a ZIP with the same chapter layout and flat sequential panel files inside each chapter.


## Setup
1. **Get Python**: 3.8+
2. **Install the requirements**: 
   ```bash
   pip install -r requirements.txt
   ```
3. **Run** the main extractor on an image or directory
    ```bash
    python manhwa-extractor.py jinwoo.jpg
    ```
4. **Extracts panels** in a folder of the image or directory name with `_output` appended 

There's a few other options to extract it in different ways if you want to play around with that.

## Web Interface

You can also use the Gradio web interface if you're not good with CLI's:

```bash
python gradio_app.py
```

This launches a local web app at `http://localhost:7860` where you can:
- Upload images through your browser
- Adjust extraction settings with sliders
- Preview extracted panels in a gallery
- Download all panels as a ZIP file

## Potential Improvements

- Have a way of doing automatic inpainting on leftover/partial speech bubbles