Fork of ScanSlicer (https://github.com/macrodev8/ScanSlicer), implementing a mirrored export patch.
Find a file
2026-03-04 14:25:25 +00:00
.scanslicer chore: add presets 2026-03-04 14:25:25 +00:00
docs docs: document AppImage workflow 2026-03-04 11:11:11 +00:00
packaging/appimage build: add AppImage packaging pipeline and build scripts 2026-03-04 11:08:29 +00:00
scanslicer refactor(ui_builders_shared): add module tail helpers and finalize layout 2026-02-26 12:25:34 +00:00
.dockerignore chore: add repository ignore and container ignore rules 2026-02-18 10:15:00 +00:00
.env.example chore: add example environment variables for desktop runtime 2026-02-18 10:31:31 +00:00
.gitignore chore: add repository ignore and container ignore rules 2026-02-18 10:15:00 +00:00
docker-compose.yml build: add docker runtime files 2026-03-04 11:12:14 +00:00
Dockerfile build: add docker runtime files 2026-03-04 11:12:14 +00:00
LICENSE docs: add GPLv3 licensing and upstream attribution 2026-03-04 13:46:58 +00:00
pyproject.toml build: add pyproject metadata for setuptools packaging 2026-02-18 10:35:00 +00:00
README.md docs: add GPLv3 licensing and upstream attribution 2026-03-04 13:46:58 +00:00
setup.py build: add legacy setuptools shim entry point 2026-02-18 11:10:54 +00:00
uv.lock build: add uv lockfile for reproducible dependency resolution 2026-02-26 15:54:55 +00:00

ScanSlicer

ScanSlicer is a desktop Qt application for extracting multiple photos from a flatbed scan image. It detects photo regions, lets you correct boxes manually, then saves perspective-corrected crops.

Inspired by PhotoSlicer by Francesco Vannini.

This repository keeps GNU GPL v3 licensing for compatibility with that upstream work.

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.
  • Works on Linux desktops over Wayland or X11.

Requirements

  • Python >=3.10
  • Linux desktop session (for example KDE Plasma) over Wayland or X11
  • System libraries required by Qt/OpenCV (see Dockerfile for a known-good package set)

Project dependencies (from pyproject.toml):

  • PySide6
  • opencv-python
  • numpy
  • Pillow

Quick Start

uv sync --frozen
uv run scanslicer

Open a specific input directory at launch:

uv run scanslicer /path/to/scans

Choose backend explicitly:

uv run scanslicer --backend wayland
uv run scanslicer --backend x11

Run with Python directly

The package directory now matches the published name:

python -m scanslicer

CLI

scanslicer [path] [--backend {auto,wayland,x11}]
  • path: optional startup directory containing scan images.
  • --backend: display backend selection. auto is default.

Typical Workflow

  1. Open an input directory.
  2. Verify output directory (defaults to the opened input directory).
  3. Click Detect (or use auto detection triggered on image load).
  4. Adjust boxes as needed.
  5. Lock boxes you want to export (or use lock-all).
  6. Choose save format (jpg or png) and quality/compression.
  7. Click Save images.

Only locked boxes are exported.

Runtime Behavior

  • Detection and auto-tune run in background worker tasks (QThreadPool) so UI stays responsive.
  • Status events are written to a session log file and reflected in the status bar.
  • Detection results are cached (normal and filter preview) to avoid unnecessary re-processing when toggling filter preview.

Data and Config Files

Default host paths:

  • Defaults: ~/.config/scanslicer/defaults.json
  • Named presets: ~/.config/scanslicer/presets.json
  • Auto-tune feedback: ~/.config/scanslicer/autotune-feedback.json
  • Session status log: ~/.config/scanslicer/status.log

Container behavior:

  • When running in container and /work exists, these are stored under /work/.scanslicer/.

Environment variable overrides:

  • SCANSLICER_DEFAULTS_PATH
  • SCANSLICER_PRESETS_PATH
  • SCANSLICER_FEEDBACK_PATH
  • SCANSLICER_STATUS_LOG_PATH

Legacy override names are still accepted for backward compatibility.

Docker Compose

The repo includes a GUI-oriented compose setup for Linux desktop use:

docker compose up --build

See .env.example and docker-compose.yml for required host UID/GID and Wayland/XDG settings.

AppImage Build

AppImage build scripts and recipe are in packaging/appimage/.

  • Local: bash packaging/appimage/build-appimage.sh
  • Dockerized build: bash packaging/appimage/build-appimage-docker.sh

Detailed instructions: docs/appimage.md.

Documentation

  • docs/README.md - documentation index
  • docs/user-guide.md - end-user operation guide
  • docs/architecture.md - code architecture and execution flow
  • docs/parameters.md - full detection parameter reference
  • docs/autotune.md - auto-tune and feedback internals
  • docs/runtime-config.md - backend/environment and persistence paths
  • docs/appimage.md - AppImage packaging details
  • docs/development.md - contributor-focused architecture/workflow notes

Repository Layout

scanslicer/                  Application source (UI, controllers, canvas, detection)
packaging/appimage/           AppImage recipe and build scripts
Dockerfile                    Runtime image
docker-compose.yml            GUI container runtime wiring
pyproject.toml                Python package metadata and dependencies