Skip to content
codegeasse1Public

About

DocuScan — modern Android document scanner. Camera capture, gallery import, auto-crop, 12+ image filters, multi-page PDF & JPG export.

Resources

Stars

21 stars

Watchers

0 watching

Forks

Repository files navigation

DocuScan 📄

A modern, local-first Android document scanner. Capture or import images, apply 22 filters, crop and rotate each page, and export as PDF or JPG.

Built with Kotlin + Jetpack Compose (Material 3) + CameraX, modeled after the MakeACopy feature set.

Screenshots

Home Auto-crop Editor Save menu Settings

Home  ·  Auto-crop  ·  Editor  ·  Save menu  ·  Settings

Features

  • 📷 Camera capture with in-app preview, flash & front/back flip (CameraX)
  • 🖼️ Gallery import (system photo picker — no storage permissions needed) with multi-select — pick as many images as the system allows (up to 100 at once) and they all become pages
  • 📄 PDF import — open an existing PDF and its pages become editable pages
  • 🧭 Manual crop — like MakeACopy: drag the four corners or the edges (parallel edge translation), with a snap-to-right-angle assist that locks near-vertical/horizontal edges to 90°. Auto runs the OpenCV edge detector and places the box on the page; the other aspect-ratio presets (Original, A3/A4/A5, US Letter, Legal, custom) immediately reshape the crop box to that ratio (and it is also enforced at warp time), so tapping a size does something visible without hand-dragging. The crop controls sit below the image (glass panel) with Rotate ⟲/⟳, aspect chips and Crop/Reset/Cancel — nothing overlaps the document
  • 🔄 Rotate — rotate a page 90° at a time, either in the editor or while cropping; the editor preview updates instantly
  • 🧩 Batch editing — with several pages loaded, the editor's "apply to all pages" switch makes filter / brightness / contrast changes hit every page at once (or just the current one), and the gallery picker imports many images in one go
  • ✨ Auto-enhance (on by default) — every page is gently auto-levelled (robust black/white points from a sampled luminance histogram, applied with a single hardware-accelerated colour-matrix pass). It runs without any OpenCV cost, so there is no noticeable CPU/battery hit, it updates live in the editor as a non-destructive overlay, and the enhanced result is what gets written into PDF/JPG exports. Turn it off in Settings if you prefer raw pages.
  • 🔎 Full-resolution pipeline — imported photos are kept at their original resolution (up to 4096 px on the long edge) and exports default to JPEG quality 100% and the High (300 dpi) PDF preset, so saving never softens your scan
  • ✨ MakeACopy document cleanup — the same OpenCV presets: Natural, Enhanced and Clean Text (background flattening, CLAHE local contrast, clean-up), on top of the 19 classic filters
  • 🎨 22 filters — Original, Natural, Enhanced, Clean Text, Magic, B&W (real Otsu threshold binarization), Grayscale, Sepia, Polaroid, Vintage, Soft, Warm, Cool, Ocean, Rose, Blue, Invert, Vivid, Faded, Crisp, Sharpen, Night
  • 🔆 Brightness & contrast sliders
  • 📚 Multi-page documents — add/remove/reorder pages (the ◀ ▶ buttons by the Pages header move the selected page; they always respond, telling you when there's nothing to move)
  • 📄 Export — PDF with page-format presets (Fit-to-image, A4, US Letter, Legal) and quality presets (High/Standard/Small/Very small, 300/200/150/110 dpi, default High); JPG with configurable quality (90–100%, default 100%) + color/B&W
  • 📨 Inbox Mode — pick a folder (SAF) and every export is automatically saved there too — great for paperless-ngx / Syncthing / Nextcloud workflows
  • ♿ Accessibility Mode — spoken + haptic feedback and volume-key shutter in the camera
  • ⬆️ In-app updates — on launch DocuScan checks the GitHub Releases feed; when a newer build is published it shows an update dialog, downloads the new APK and hands it to the system installer (with a link to the release page for anyone who'd rather download manually)
  • 📤 Share with one tap (PDF or JPG)
  • 🗂️ Document library — browse, view, re-share or delete past scans, with search over titles
  • 📨 Share-to-scan — open an image from any app with "Send to DocuScan"
  • 🌙 Modern Material 3 UI with translucent "glass" control panels (so the document is never covered), light/dark/system theme

Scanning, filtering and export all happen on-device — no accounts and no uploads. The only network call is the update check against GitHub Releases described above (skipped silently if there's no connection).

Download

Grab the latest signed APK from the Releases tab — every push to main is auto-built and released by GitHub Actions.

Releases are signed with DocuScan's shared signing key, so a new build installs over the previous one — no uninstall needed. Installs from before the shared key was introduced need a one-time uninstall.

Maintainers: provide the SIGNING_KEY (base64-encoded keystore), KEY_STORE_PASSWORD, KEY_PASSWORD and ALIAS repository secrets. CI decodes the keystore, signs the release with it and verifies the APK signature before publishing. To rotate the key: keytool -genkeypair -keystore release.jks -alias <alias> -keyalg RSA -keysize 2048 -validity 10000, then base64 -w0 release.jks and update the secrets.

Building locally

# JDK 17 required
./gradlew :app:assembleDebug     # debug build
./gradlew :app:assembleRelease   # release build (unsigned unless a keystore exists)

Or just open the repo in Android Studio and press Run.

  • minSdk: 26 (Android 8.0)
  • targetSdk: 35

Project layout

app/src/main/java/com/docuscan/app/
├── MainActivity.kt        # Compose entry point + volume-key shutter (A11y)
├── App.kt                 # Navigation + bottom bar
├── A11y.kt                # Accessibility Mode: TTS + haptics
├── DocViewModel.kt        # Shared state (pages, settings, history)
├── scan/                  # The engine
│   ├── Cleanup.kt         # OpenCV document cleanup (Natural/Enhanced/Clean Text) + corner detector
│   ├── WarpTarget.kt      # Warp target size: Zhang & He projective estimate + fixed ratios
│   ├── ImageFilters.kt    # 22 filters (incl. MakeACopy cleanup presets) + Otsu B&W + sharpen
│   ├── CropGeometry.kt    # Edge dragging + snap-to-right-angle geometry (MakeACopy port)
│   ├── CropAspectRatio.kt # Crop aspect-ratio presets enforced at warp time
│   ├── PdfImport.kt       # PdfRenderer -> page bitmaps
│   ├── BitmapUtil.kt      # Rotate/crop/perspective-warp/EXIF/grayscale
│   ├── PdfExporter.kt     # android.graphics.pdf PDF writer (page format + DPI presets)
│   ├── MediaSaver.kt      # MediaStore saves + inbox folder writes
│   └── Exporter.kt        # Export pipeline (PDF/JPG + inbox mirror)
├── data/                  # History + settings persistence + PDF page-format/quality options
├── update/Updater.kt      # GitHub Releases update check + APK download/install
├── ui/                    # Screens (Home, Camera, Editor, Crop, Documents, Settings) + UpdateDialog
└── util/ShareUtil.kt      # Sharing via FileProvider

Third-party licenses

  • OpenCV 4.13.0 (Apache 2.0) — corner detection and document cleanup presets, like MakeACopy.

License

MIT — see LICENSE.

About

DocuScan — modern Android document scanner. Camera capture, gallery import, auto-crop, 12+ image filters, multi-page PDF & JPG export.

Resources

Stars

21 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages