pcleaner


Namepcleaner JSON
Version 2.6.2 PyPI version JSON
download
home_pagehttps://github.com/VoxelCubes/PanelCleaner
SummaryAn AI-powered tool to clean manga panels.
upload_time2024-05-02 00:03:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords image processing cleaning text removal manga ai machine learning
VCS
bugtrack_url
requirements opencv-python Pillow torch torchvision tqdm numpy scipy pyclipper shapely natsort docopt-ng ConfigUpdater transformers manga_ocr loguru prettytable colorama requests xdg PySide6 tifffile attrs psutil dictdiffer humanfriendly simple_lama_inpainting python-magic python-magic-bin dbus-python pywin32 win10toast pyuac PyYAML
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Panel Cleaner

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/voxelcubes/PanelCleaner?logo=GitHub)](https://github.com/voxelcubes/PanelCleaner/releases)
[![PyPI version](https://img.shields.io/pypi/v/pcleaner)](https://pypi.org/project/pcleaner/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Crowdin](https://badges.crowdin.net/panel-cleaner/localized.svg)](https://crowdin.com/project/panel-cleaner)

This tool uses machine learning to find text and then generates masks to cover it up with the highest accuracy possible. It is designed to clean easy bubbles, no in-painting or out-of-bubble text removal is done. This is intended to save a lot of monotonous work for people who have to clean a lot of panels, while making sure it doesn't paint over anything that it wasn't supposed to.

![Example](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/spread.png)

![Example](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/screenshots/cleaning_done.png)

![Example](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/screenshots/details.png)


Visualized in the top right page: 

- Various boxes are drawn where the AI found text. 

- (Green) The AI also generates a precise mask where it detected text. 

- (Purple) These masks are expanded to cover any nearby text that wasn't detected, as well as jpeg artifacts.

- (Blue) For masks that are a tight fit, the border around the edge of the mask is denoised for final clean-up, without affecting the rest of the image.

The two bottom pages are what the program can output: either just the transparent mask layer and/or the mask applied to the original image, cleaning it.

## Contents
> [Features](#features) \
> [Limitations](#limitations) \
> [Why Use This Program?](#why-use-this-program) \
> [Installation](#installation) \
> [Usage](#usage) \
> [Profiles](#profiles) \
> [OCR](#ocr) \
> [Examples](#examples-of-tricky-bubbles) \
> [Acknowledgements](#acknowledgements) \
> [License](#license) \
> [Roadmap](#roadmap) \
> [FAQ (Frequently Asked Questions)](https://github.com/VoxelCubes/PanelCleaner/blob/master/docs/faq.md) \
> [Translating](https://github.com/VoxelCubes/PanelCleaner/blob/master/translations/TRANSLATING.md) 


## Features

- Cleans text bubbles without leaving artifacts.

- Avoids painting over parts of the image that aren't text.

- Inpaints bubbles that can't simply be masked out.

- Ignores bubbles containing only symbols or numbers, as those don't need translation.

- Offers a GUI for easy use, dark, light, and system themes are supported.

- No internet connection required after installing the model data.

- Offers a plethora of options to customize the cleaning process and the ability to save multiple presets as profiles.
  See the [default profile](https://github.com/VoxelCubes/PanelCleaner/blob/master/media/default.conf) for a list of all options.

- Provides detailed analytics on the cleaning process, to see how your settings affect the results.

- Supports CUDA acceleration, if installed as a python package and your hardware supports it.

- Supports batch processing of images and directories.

- Can handle bubbles on any solid grayscale background color.

- Can also cut out the text from the rest of the image, e.g. to paste it over a colored rendition.

- Can also run OCR on the pages and output the text to a file.

- Interface available in: English, German (See [Translating](https://github.com/VoxelCubes/PanelCleaner/blob/master/translations/TRANSLATING.md) for more languages)


## Limitations

- It only supports Japanese and English text for cleaning (success may vary with other languages), Japanese only for OCR.

- Supported file types: .jpeg, .jpg, .png, .bmp, .tiff, .tif, .jp2, .dib, .webp, .ppm

- The program relies on AI for the initial text detection, which by nature is imperfect. Sometimes it will miss little bits of text or think part of the bubble belongs to the text, which will prevent that bubble from being cleaned. From testing, this typically affects between 2–8% of bubbles, depending on your settings.

- Due to the conservative approach taken in the selection of masks, if the program can't clean the bubble to a satisfying degree, it will skip that bubble outright. This does, however, also prevent false positives.

- For masks, only grayscale is currently supported. This means it can cover up text in white, black, or gray bubbles, but not colored ones.


## Why Use This Program?

This program is designed to precisely and fully clean text bubbles, without leaving any artifacts.
Its aim is to save a cleaner's time, by taking care of monotonous work.
The [AI](https://github.com/dmMaze/comic-text-detector) used to detect text and generate the initial mask was *not* created as part of this project, this project merely uses it as a starting point and improves upon the output.

| Original                             | AI Output                           | Panel Cleaner                          |
|:------------------------------------:|:-----------------------------------:|:--------------------------------------:|
| ![Original](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_original.png) | ![AI Output](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_ai_raw.png) | ![Panel Cleaner](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_clean.png) |

As you can see, with a bit of extra cleanup applied to the AI output, some leftover text and jpeg compression artifacts are removed, and the bubble is fully cleaned. \
When fully cleaning it isn't possible, Panel Cleaner will instead skip the bubble so as not to waste your time with a poorly cleaned bit of text. The exact cleaning behavior is highly configurable, see [Profiles](#profiles) for more details.


## Installation

You have the choice between installing a pre-built binary from the [releases section](https://github.com/VoxelCubes/PanelCleaner/releases/latest) 
or installing it to your local python interpreter using pip.

Note: All versions will need to download model data on first launch (approx. 500MB). This model data will not need to be downloaded again if Panel Cleaner updates.

Important: The pre-built binaries do not support CUDA acceleration. To use CUDA, you must install the program with pip and ensure you install the appropriate [pytorch](https://pytorch.org/get-started/locally/) version for your system.

### Install with Pip

The program requires **Python 3.10** or newer.

Install the program with pip from [PyPI](https://pypi.org/project/pcleaner/):
```bash
pip install pcleaner
```

Note: The program has been tested to work on Linux, MacOS, and Windows, with varying levels of setup required. See the [FAQ](https://github.com/VoxelCubes/PanelCleaner/blob/master/docs/faq.md) for help.

### Installation from the Arch User Repository

This installs the program in a `pipx` environment, which allows pytorch to download the appropriate CUDA version for your system, making this the best method of installation.

You can find the package here: [panelcleaner](https://aur.archlinux.org/packages/panelcleaner)

This will provide the `pcleaner` and `pcleaner-gui` commands, along with a desktop file for the GUI.

Install it with your favorite AUR helper, e.g. with `yay`:
```bash
yay -S panelcleaner
```

### Installation with Flatpak

This installs the prebuilt binary in a flatpak container, which does not support CUDA acceleration.

[Get it on Flathub](https://flathub.org/apps/io.github.voxelcubes.panelcleaner)

### Install with Docker

Build the image with buildx:
```bash
docker buildx build -t pcleaner:v1 .
```
Or with the legacy builder:
```bash
docker image build -t pcleaner:v1 .
```

Then initialize the docker image, specifying a root folder for the container to access.
In this example, the current directory (`pwd`) is used:
```bash
docker run -it --name pcleaner -v $(pwd):/app pcleaner:v1
```
This will also start an interactive shell in the container.

You can open another one later on with:
```bash
docker start pcleaner
docker exec -it pcleaner bash
```

## Command Line Usage

The program can be run from the command line, and, in the most common use, takes any number of images or directories as input. The program will create a new directory called `cleaned` in the same directory as the input files, and place the cleaned images and/or masks there. Often, it's more useful to only export the mask layer, and you can do so by adding the `--save-only-mask`, or `-m` for short, option.

Examples:
```bash
pcleaner clean image1.png image2.png image3.png

pcleaner clean -m folder1 image1.png
```

Demonstration with 46 images, real time, with CUDA acceleration.
![Demonstration](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/pcleaner_demo.gif)

There are many more options, which can be seen by running
```bash
pcleaner --help
```

### Launching the GUI using the Command Line

The GUI can be launched from the command line using the `gui` command:
```bash
pcleaner gui
```
or directly with
```bash
pcleaner-gui
```

If pcleaner cannot be found, ensure it is in your PATH variable, or try
```bash
python -m pcleaner
```
instead.


## Profiles

The program exposes every setting possible in a configuration profile, which are saved as simple text files and can also be accessed using the GUI. Each configuration option is explained inside the file itself, allowing you to optimize each parameter of the cleaning process for your specific needs. \
Just generate a new profile with
```bash
pcleaner profile new my_profile_name_here
```

and it will open your new profile for you in a text editor. \
Here is a tiny snippet from the default profile, for example:
```ini
# Number of pixels to grow the mask by each step. 
# This bulks up the outline of the mask, so smaller values will be more accurate but slower.
mask_growth_step_pixels = 2

# Number of steps to grow the mask by.
# A higher number will make more and larger masks, ultimately limited by the reference box size.
mask_growth_steps = 11
```

Run the cleaner with your specified profile by adding `--profile=my_profile_name_here` or
`-p my_profile_name_here` to the command.

If you are having trouble seeing how the settings affect the results, you can use the 
`--cache-masks` option to save visualizations of intermediate steps to the cache directory.

| Default Profile                                | Custom Profile                              |
| ---------------------------------------------- | ------------------------------------------- |
| ![Default Profile](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/profile_original.png) | ![Custom Profile](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/profile_modded.png) |
| mask_growth_step_pixels = 2                    | mask_growth_step_pixels = 4                 |
| mask_growth_steps = 11                         | mask_growth_steps = 4                       |

Additionally, analytics are provided for each processing step in the terminal, so you can see how your settings affect the results on a whole.

See the [default profile](https://github.com/VoxelCubes/PanelCleaner/blob/master/media/default.conf) for a list of all options.

Note: The default profile is optimized for images roughly 1100x1600 pixels in size.
Adjust size parameters accordingly in a profile if you are using images with a significantly
lower or higher resolution.


## OCR

You can also use Panel Cleaner to perform Optical Character Recognition (OCR) on the pages,
and output the text to a file. This could be useful to assist in translation, or to extract
text for analytical purposes. \
You can run OCR with:
```bash
pcleaner ocr myfolder --output-path=output.txt
```
This is also available in the GUI, as the OCR output option.


## Examples of Tricky Bubbles

| Original | Cleaned |
|:--------:|:-------:|
| ![Square bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/square_bubble_raw.png) | ![Square bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/square_bubble_clean.png) |
| ![Handwritten bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/handwritten_bubble_raw.png) | ![Handwritten bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/handwritten_bubble_clean.png) |
| ![Black bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/black_bubble_raw.png) | ![Black bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/black_bubble_clean.png) |
| ![Ray bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/ray_bubble_raw.png) | ![Ray bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/ray_bubble_clean.png) |
| ![Nightmare bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/nightmare_bubble_raw.png) | ![Nightmare bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/nightmare_bubble_clean.png) |
| ![Spikey bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/spikey_bubble_raw.png) | ![Spikey bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/spikey_bubble_clean.png) |
| ![Darkrays bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/darkrays_bubble_raw.png) | ![Darkrays bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/darkrays_bubble_clean.png) |



## Acknowledgements

- [Comic Text Detector](https://github.com/dmMaze/comic-text-detector) for finding text bubbles and generating the initial mask.

- [Manga OCR](https://github.com/kha-white/manga-ocr) for detecting which bubbles only contain symbols or numbers,
  and performing the dedicated OCR command.

- [Simple Lama Inpainting](https://github.com/enesmsahin/simple-lama-inpainting) for inpainting bubbles that can't be masked out.


## License

This project is licensed under the GNU General Public License v3.0 – see
the [LICENSE](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/LICENSE) file for details.


## Roadmap

- [x] Maybe make a GUI for it.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/VoxelCubes/PanelCleaner",
    "name": "pcleaner",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "image processing, cleaning, text removal, manga, ai, machine learning",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/68/78/6de608b3b042645c5e762800fe793d75a6ade06cc52a458f25da779519b0/pcleaner-2.6.2.tar.gz",
    "platform": null,
    "description": "# Panel Cleaner\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/voxelcubes/PanelCleaner?logo=GitHub)](https://github.com/voxelcubes/PanelCleaner/releases)\n[![PyPI version](https://img.shields.io/pypi/v/pcleaner)](https://pypi.org/project/pcleaner/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Crowdin](https://badges.crowdin.net/panel-cleaner/localized.svg)](https://crowdin.com/project/panel-cleaner)\n\nThis tool uses machine learning to find text and then generates masks to cover it up with the highest accuracy possible. It is designed to clean easy bubbles, no in-painting or out-of-bubble text removal is done. This is intended to save a lot of monotonous work for people who have to clean a lot of panels, while making sure it doesn't paint over anything that it wasn't supposed to.\n\n![Example](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/spread.png)\n\n![Example](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/screenshots/cleaning_done.png)\n\n![Example](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/screenshots/details.png)\n\n\nVisualized in the top right page: \n\n- Various boxes are drawn where the AI found text. \n\n- (Green) The AI also generates a precise mask where it detected text. \n\n- (Purple) These masks are expanded to cover any nearby text that wasn't detected, as well as jpeg artifacts.\n\n- (Blue) For masks that are a tight fit, the border around the edge of the mask is denoised for final clean-up, without affecting the rest of the image.\n\nThe two bottom pages are what the program can output: either just the transparent mask layer and/or the mask applied to the original image, cleaning it.\n\n## Contents\n> [Features](#features) \\\n> [Limitations](#limitations) \\\n> [Why Use This Program?](#why-use-this-program) \\\n> [Installation](#installation) \\\n> [Usage](#usage) \\\n> [Profiles](#profiles) \\\n> [OCR](#ocr) \\\n> [Examples](#examples-of-tricky-bubbles) \\\n> [Acknowledgements](#acknowledgements) \\\n> [License](#license) \\\n> [Roadmap](#roadmap) \\\n> [FAQ (Frequently Asked Questions)](https://github.com/VoxelCubes/PanelCleaner/blob/master/docs/faq.md) \\\n> [Translating](https://github.com/VoxelCubes/PanelCleaner/blob/master/translations/TRANSLATING.md) \n\n\n## Features\n\n- Cleans text bubbles without leaving artifacts.\n\n- Avoids painting over parts of the image that aren't text.\n\n- Inpaints bubbles that can't simply be masked out.\n\n- Ignores bubbles containing only symbols or numbers, as those don't need translation.\n\n- Offers a GUI for easy use, dark, light, and system themes are supported.\n\n- No internet connection required after installing the model data.\n\n- Offers a plethora of options to customize the cleaning process and the ability to save multiple presets as profiles.\n  See the [default profile](https://github.com/VoxelCubes/PanelCleaner/blob/master/media/default.conf) for a list of all options.\n\n- Provides detailed analytics on the cleaning process, to see how your settings affect the results.\n\n- Supports CUDA acceleration, if installed as a python package and your hardware supports it.\n\n- Supports batch processing of images and directories.\n\n- Can handle bubbles on any solid grayscale background color.\n\n- Can also cut out the text from the rest of the image, e.g. to paste it over a colored rendition.\n\n- Can also run OCR on the pages and output the text to a file.\n\n- Interface available in: English, German (See [Translating](https://github.com/VoxelCubes/PanelCleaner/blob/master/translations/TRANSLATING.md) for more languages)\n\n\n## Limitations\n\n- It only supports Japanese and English text for cleaning (success may vary with other languages), Japanese only for OCR.\n\n- Supported file types: .jpeg, .jpg, .png, .bmp, .tiff, .tif, .jp2, .dib, .webp, .ppm\n\n- The program relies on AI for the initial text detection, which by nature is imperfect. Sometimes it will miss little bits of text or think part of the bubble belongs to the text, which will prevent that bubble from being cleaned. From testing, this typically affects between 2\u20138% of bubbles, depending on your settings.\n\n- Due to the conservative approach taken in the selection of masks, if the program can't clean the bubble to a satisfying degree, it will skip that bubble outright. This does, however, also prevent false positives.\n\n- For masks, only grayscale is currently supported. This means it can cover up text in white, black, or gray bubbles, but not colored ones.\n\n\n## Why Use This Program?\n\nThis program is designed to precisely and fully clean text bubbles, without leaving any artifacts.\nIts aim is to save a cleaner's time, by taking care of monotonous work.\nThe [AI](https://github.com/dmMaze/comic-text-detector) used to detect text and generate the initial mask was *not* created as part of this project, this project merely uses it as a starting point and improves upon the output.\n\n| Original                             | AI Output                           | Panel Cleaner                          |\n|:------------------------------------:|:-----------------------------------:|:--------------------------------------:|\n| ![Original](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_original.png) | ![AI Output](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_ai_raw.png) | ![Panel Cleaner](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_clean.png) |\n\nAs you can see, with a bit of extra cleanup applied to the AI output, some leftover text and jpeg compression artifacts are removed, and the bubble is fully cleaned. \\\nWhen fully cleaning it isn't possible, Panel Cleaner will instead skip the bubble so as not to waste your time with a poorly cleaned bit of text. The exact cleaning behavior is highly configurable, see [Profiles](#profiles) for more details.\n\n\n## Installation\n\nYou have the choice between installing a pre-built binary from the [releases section](https://github.com/VoxelCubes/PanelCleaner/releases/latest) \nor installing it to your local python interpreter using pip.\n\nNote: All versions will need to download model data on first launch (approx. 500MB). This model data will not need to be downloaded again if Panel Cleaner updates.\n\nImportant: The pre-built binaries do not support CUDA acceleration. To use CUDA, you must install the program with pip and ensure you install the appropriate [pytorch](https://pytorch.org/get-started/locally/) version for your system.\n\n### Install with Pip\n\nThe program requires **Python 3.10** or newer.\n\nInstall the program with pip from [PyPI](https://pypi.org/project/pcleaner/):\n```bash\npip install pcleaner\n```\n\nNote: The program has been tested to work on Linux, MacOS, and Windows, with varying levels of setup required. See the [FAQ](https://github.com/VoxelCubes/PanelCleaner/blob/master/docs/faq.md) for help.\n\n### Installation from the Arch User Repository\n\nThis installs the program in a `pipx` environment, which allows pytorch to download the appropriate CUDA version for your system, making this the best method of installation.\n\nYou can find the package here: [panelcleaner](https://aur.archlinux.org/packages/panelcleaner)\n\nThis will provide the `pcleaner` and `pcleaner-gui` commands, along with a desktop file for the GUI.\n\nInstall it with your favorite AUR helper, e.g. with `yay`:\n```bash\nyay -S panelcleaner\n```\n\n### Installation with Flatpak\n\nThis installs the prebuilt binary in a flatpak container, which does not support CUDA acceleration.\n\n[Get it on Flathub](https://flathub.org/apps/io.github.voxelcubes.panelcleaner)\n\n### Install with Docker\n\nBuild the image with buildx:\n```bash\ndocker buildx build -t pcleaner:v1 .\n```\nOr with the legacy builder:\n```bash\ndocker image build -t pcleaner:v1 .\n```\n\nThen initialize the docker image, specifying a root folder for the container to access.\nIn this example, the current directory (`pwd`) is used:\n```bash\ndocker run -it --name pcleaner -v $(pwd):/app pcleaner:v1\n```\nThis will also start an interactive shell in the container.\n\nYou can open another one later on with:\n```bash\ndocker start pcleaner\ndocker exec -it pcleaner bash\n```\n\n## Command Line Usage\n\nThe program can be run from the command line, and, in the most common use, takes any number of images or directories as input. The program will create a new directory called `cleaned` in the same directory as the input files, and place the cleaned images and/or masks there. Often, it's more useful to only export the mask layer, and you can do so by adding the `--save-only-mask`, or `-m` for short, option.\n\nExamples:\n```bash\npcleaner clean image1.png image2.png image3.png\n\npcleaner clean -m folder1 image1.png\n```\n\nDemonstration with 46 images, real time, with CUDA acceleration.\n![Demonstration](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/pcleaner_demo.gif)\n\nThere are many more options, which can be seen by running\n```bash\npcleaner --help\n```\n\n### Launching the GUI using the Command Line\n\nThe GUI can be launched from the command line using the `gui` command:\n```bash\npcleaner gui\n```\nor directly with\n```bash\npcleaner-gui\n```\n\nIf pcleaner cannot be found, ensure it is in your PATH variable, or try\n```bash\npython -m pcleaner\n```\ninstead.\n\n\n## Profiles\n\nThe program exposes every setting possible in a configuration profile, which are saved as simple text files and can also be accessed using the GUI. Each configuration option is explained inside the file itself, allowing you to optimize each parameter of the cleaning process for your specific needs. \\\nJust generate a new profile with\n```bash\npcleaner profile new my_profile_name_here\n```\n\nand it will open your new profile for you in a text editor. \\\nHere is a tiny snippet from the default profile, for example:\n```ini\n# Number of pixels to grow the mask by each step. \n# This bulks up the outline of the mask, so smaller values will be more accurate but slower.\nmask_growth_step_pixels = 2\n\n# Number of steps to grow the mask by.\n# A higher number will make more and larger masks, ultimately limited by the reference box size.\nmask_growth_steps = 11\n```\n\nRun the cleaner with your specified profile by adding `--profile=my_profile_name_here` or\n`-p my_profile_name_here` to the command.\n\nIf you are having trouble seeing how the settings affect the results, you can use the \n`--cache-masks` option to save visualizations of intermediate steps to the cache directory.\n\n| Default Profile                                | Custom Profile                              |\n| ---------------------------------------------- | ------------------------------------------- |\n| ![Default Profile](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/profile_original.png) | ![Custom Profile](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/profile_modded.png) |\n| mask_growth_step_pixels = 2                    | mask_growth_step_pixels = 4                 |\n| mask_growth_steps = 11                         | mask_growth_steps = 4                       |\n\nAdditionally, analytics are provided for each processing step in the terminal, so you can see how your settings affect the results on a whole.\n\nSee the [default profile](https://github.com/VoxelCubes/PanelCleaner/blob/master/media/default.conf) for a list of all options.\n\nNote: The default profile is optimized for images roughly 1100x1600 pixels in size.\nAdjust size parameters accordingly in a profile if you are using images with a significantly\nlower or higher resolution.\n\n\n## OCR\n\nYou can also use Panel Cleaner to perform Optical Character Recognition (OCR) on the pages,\nand output the text to a file. This could be useful to assist in translation, or to extract\ntext for analytical purposes. \\\nYou can run OCR with:\n```bash\npcleaner ocr myfolder --output-path=output.txt\n```\nThis is also available in the GUI, as the OCR output option.\n\n\n## Examples of Tricky Bubbles\n\n| Original | Cleaned |\n|:--------:|:-------:|\n| ![Square bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/square_bubble_raw.png) | ![Square bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/square_bubble_clean.png) |\n| ![Handwritten bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/handwritten_bubble_raw.png) | ![Handwritten bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/handwritten_bubble_clean.png) |\n| ![Black bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/black_bubble_raw.png) | ![Black bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/black_bubble_clean.png) |\n| ![Ray bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/ray_bubble_raw.png) | ![Ray bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/ray_bubble_clean.png) |\n| ![Nightmare bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/nightmare_bubble_raw.png) | ![Nightmare bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/nightmare_bubble_clean.png) |\n| ![Spikey bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/spikey_bubble_raw.png) | ![Spikey bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/spikey_bubble_clean.png) |\n| ![Darkrays bubble raw](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/darkrays_bubble_raw.png) | ![Darkrays bubble clean](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/media/demo_bubbles/darkrays_bubble_clean.png) |\n\n\n\n## Acknowledgements\n\n- [Comic Text Detector](https://github.com/dmMaze/comic-text-detector) for finding text bubbles and generating the initial mask.\n\n- [Manga OCR](https://github.com/kha-white/manga-ocr) for detecting which bubbles only contain symbols or numbers,\n  and performing the dedicated OCR command.\n\n- [Simple Lama Inpainting](https://github.com/enesmsahin/simple-lama-inpainting) for inpainting bubbles that can't be masked out.\n\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 \u2013 see\nthe [LICENSE](https://raw.githubusercontent.com/VoxelCubes/PanelCleaner/master/LICENSE) file for details.\n\n\n## Roadmap\n\n- [x] Maybe make a GUI for it.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An AI-powered tool to clean manga panels.",
    "version": "2.6.2",
    "project_urls": {
        "Homepage": "https://github.com/VoxelCubes/PanelCleaner"
    },
    "split_keywords": [
        "image processing",
        " cleaning",
        " text removal",
        " manga",
        " ai",
        " machine learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47671d455dd213e9e4be8730e673e02435f777437f0981613fb6669485f0b852",
                "md5": "b36c5786d0854ec964e296f5c92d8756",
                "sha256": "d43587a2ee1d574780570c5e2c4c66bb73f1d8b4eee6f107d4643c7d692b1997"
            },
            "downloads": -1,
            "filename": "pcleaner-2.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b36c5786d0854ec964e296f5c92d8756",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 1092948,
            "upload_time": "2024-05-02T00:03:56",
            "upload_time_iso_8601": "2024-05-02T00:03:56.217311Z",
            "url": "https://files.pythonhosted.org/packages/47/67/1d455dd213e9e4be8730e673e02435f777437f0981613fb6669485f0b852/pcleaner-2.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68786de608b3b042645c5e762800fe793d75a6ade06cc52a458f25da779519b0",
                "md5": "3f116ef7180de89bd26cc182d6bea87e",
                "sha256": "d0f9312d2322f07be78df9c632125f71896458436e20b67478f61ca4f3a315f3"
            },
            "downloads": -1,
            "filename": "pcleaner-2.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3f116ef7180de89bd26cc182d6bea87e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 1049347,
            "upload_time": "2024-05-02T00:03:59",
            "upload_time_iso_8601": "2024-05-02T00:03:59.092028Z",
            "url": "https://files.pythonhosted.org/packages/68/78/6de608b3b042645c5e762800fe793d75a6ade06cc52a458f25da779519b0/pcleaner-2.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 00:03:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "VoxelCubes",
    "github_project": "PanelCleaner",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "opencv-python",
            "specs": []
        },
        {
            "name": "Pillow",
            "specs": []
        },
        {
            "name": "torch",
            "specs": []
        },
        {
            "name": "torchvision",
            "specs": []
        },
        {
            "name": "tqdm",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "scipy",
            "specs": []
        },
        {
            "name": "pyclipper",
            "specs": []
        },
        {
            "name": "shapely",
            "specs": []
        },
        {
            "name": "natsort",
            "specs": []
        },
        {
            "name": "docopt-ng",
            "specs": []
        },
        {
            "name": "ConfigUpdater",
            "specs": []
        },
        {
            "name": "transformers",
            "specs": []
        },
        {
            "name": "manga_ocr",
            "specs": []
        },
        {
            "name": "loguru",
            "specs": []
        },
        {
            "name": "prettytable",
            "specs": []
        },
        {
            "name": "colorama",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "xdg",
            "specs": []
        },
        {
            "name": "PySide6",
            "specs": []
        },
        {
            "name": "tifffile",
            "specs": []
        },
        {
            "name": "attrs",
            "specs": []
        },
        {
            "name": "psutil",
            "specs": []
        },
        {
            "name": "dictdiffer",
            "specs": []
        },
        {
            "name": "humanfriendly",
            "specs": []
        },
        {
            "name": "simple_lama_inpainting",
            "specs": []
        },
        {
            "name": "python-magic",
            "specs": []
        },
        {
            "name": "python-magic-bin",
            "specs": []
        },
        {
            "name": "dbus-python",
            "specs": []
        },
        {
            "name": "pywin32",
            "specs": []
        },
        {
            "name": "win10toast",
            "specs": []
        },
        {
            "name": "pyuac",
            "specs": []
        },
        {
            "name": "PyYAML",
            "specs": []
        }
    ],
    "lcname": "pcleaner"
}
        
Elapsed time: 0.40118s