2026-09-11 23:24:54 +02:00
# ScanSlicer (fork)
2026-03-04 12:49:18 +00:00
2026-09-12 15:32:58 +02:00
ScanSlicer is a desktop Qt application (Python/PySide6) that detects multiple photos in a flatbed scan image, lets you correct each box manually, and exports perspective-corrected crops. It runs on Linux desktops over Wayland or X11.
2026-03-04 13:46:58 +00:00
2026-09-12 15:32:58 +02:00
This is a **fork of [macrodev8/ScanSlicer](https://github.com/macrodev8/ScanSlicer)** .
2026-03-04 13:46:58 +00:00
2026-09-11 23:24:54 +02:00
Upstream credit: the original is inspired by
2026-09-12 15:32:58 +02:00
[PhotoSlicer ](https://github.com/francescovannini/photoslicer ) by Francesco Vannini. This repository keeps the GNU GPL v3 license for compatibility with that upstream work.
2026-09-11 23:24:54 +02:00
## Changes from upstream
2026-09-12 15:32:58 +02:00
- Fixed mirrored slice exports: added an explicit left/right orientation workflow with a **Swap L/R** button and color-coded left/right corners and edges.
- Orientation corrections now persist through "squarize" and "reset rotation" (previously they were silently overwritten).
- Hardened dependencies: switched to `opencv-python-headless` , removed the unused Pillow dependency, and made the AppImage build verify package hashes.
2026-03-04 12:49:18 +00:00
## What It Does
- Detects photo boxes from `.png` , `.jpg` , and `.jpeg` source images.
- Supports threshold-based and Canny-based detection pipelines.
- Provides manual correction tools (corner drag, edge drag, rotate, move, add/remove box).
- Saves only locked boxes, each as a perspective-corrected output image.
- Includes auto-tuning with feedback learning from your prior saved results.
## Requirements
2026-09-11 23:24:54 +02:00
- Python >= 3.10
- A Linux desktop session over Wayland or X11
- System libraries required by Qt/OpenCV (see `Dockerfile` for a known-good set)
2026-03-04 12:49:18 +00:00
2026-09-11 23:24:54 +02:00
Project dependencies (from `pyproject.toml` ): `PySide6` , `opencv-python-headless` , `numpy` .
2026-03-04 12:49:18 +00:00
## Quick Start
2026-09-12 15:32:58 +02:00
### Run the AppImage (recommended)
Use the provided AppImage file under "Releases", or build and run it yourself:
```bash
bash packaging/appimage/build-appimage-docker.sh
./appimage/dist/ScanSlicer-< version > -x86_64.AppImage
```
See [docs/appimage.md ](docs/appimage.md ) for full details.
2026-09-11 23:24:54 +02:00
### Run from source (uv)
2026-03-04 12:49:18 +00:00
```bash
uv sync --frozen
uv run scanslicer /path/to/scans
```
2026-09-11 23:24:54 +02:00
Open with no startup directory, or select the display backend explicitly:
2026-03-04 12:49:18 +00:00
```bash
2026-09-11 23:24:54 +02:00
uv run scanslicer
2026-03-04 12:49:18 +00:00
uv run scanslicer --backend wayland
uv run scanslicer --backend x11
```
2026-09-11 23:24:54 +02:00
You can also run the installed package directly with `python -m scanslicer` .
2026-03-04 12:49:18 +00:00
### CLI
```text
scanslicer [path] [--backend {auto,wayland,x11}]
```
## Typical Workflow
1. Open an input directory.
2026-09-11 23:24:54 +02:00
2. Verify the output directory (defaults to the opened input directory).
3. Run detection (`Detect` ), or rely on automatic detection on image load.
4. Adjust boxes as needed (drag corners/edges, rotate, move, add/remove).
5. Lock the boxes to export (or use lock-all).
6. Choose the save format (`jpg` or `png` ) and quality/compression.
2026-03-04 12:49:18 +00:00
7. Click `Save images` .
Only locked boxes are exported.
2026-09-11 23:24:54 +02:00
## Configuration
2026-03-04 12:49:18 +00:00
2026-09-12 15:32:58 +02:00
ScanSlicer stores its defaults, presets, auto-tune feedback, and a session status log under `~/.config/scanslicer/` (or `$XDG_CONFIG_HOME/scanslicer/` ). All paths can be overridden via `SCANSLICER_*_PATH` environment variables. See
2026-09-11 23:24:54 +02:00
[docs/runtime-config.md ](docs/runtime-config.md ).
2026-03-04 12:49:18 +00:00
2026-09-11 23:24:54 +02:00
## Docker
2026-03-04 14:26:14 +00:00
2026-09-11 23:24:54 +02:00
A GUI-oriented compose setup is provided for Linux desktop use:
2026-03-04 12:49:18 +00:00
```bash
docker compose up --build
```
2026-09-12 15:32:58 +02:00
See `.env.example` and `docker-compose.yml` for host UID/GID and Wayland/XDG settings.
2026-03-04 12:49:18 +00:00
## Documentation
2026-09-12 15:32:58 +02:00
See [docs/README.md ](docs/README.md ) for an index and recommended reading order (end-user guide, parameters, auto-tune, architecture, runtime config, AppImage, development).
2026-03-04 12:49:18 +00:00
2026-09-11 23:24:54 +02:00
## Repository
2026-03-04 12:49:18 +00:00
```text
2026-09-11 23:24:54 +02:00
scanslicer/ application source (package)
packaging/appimage/ AppImage recipe and build scripts
docs/ end-user and developer documentation
Dockerfile / docker-compose.yml container runtime
pyproject.toml / uv.lock package metadata and pinned dependencies
2026-03-04 12:49:18 +00:00
```
2026-09-11 23:24:54 +02:00
## License
GNU GPL v3 — see [LICENSE ](LICENSE ). See
[THIRD_PARTY_NOTICES ](THIRD_PARTY_NOTICES ) for bundled third-party components.