Skip to main content

OpenFocus

OpenFocus

Every pixel, its sharpest frame.

Eleven fusion algorithms, five alignment choices and a source-locked retouch workspace for macro, microscopy and industrial stacks. 16-bit end to end, a headless CLI, and a UI in twelve languages.

Release Stars License: Apache-2.0 and model terms Python 3.10+

Windows 10/11 macOS Apple Silicon Linux x86-64 desktop and CLI PyPI

Download · Docs · Changelog · DOI

English · 简体中文 · 日本語 · Español · Deutsch · Français · Русский · 한국어 · Português · Italiano · Nederlands · Polski

OpenFocus interface

📢 News

Earlier releases are in the Changelog.

📸 If you publish images created with OpenFocus, please consider adding a note such as:

Created with OpenFocus — https://github.com/Xinzhe99/OpenFocus

This is not mandatory, but highly appreciated.

Features

AI fusion

StackMFF V4 blends or selects sharply focused source pixels and estimates focus depth. The demo shows StackMFF V3.

Fusion methods → · Benchmark →

StackMFF V3 versus Guided Filter on the same stack

Wipe compare

Compare a source frame with the result using a draggable divider.

Manual →

A/B wipe between a source frame and the fused result

Method comparison

Compare methods side by side and reuse the best result or settings.

Side-by-side comparison of fusion methods

Depth map & 3D

Create depth maps, calibrate physical Z, and export textured 3D surfaces.

Depth map and 3D surface of the same stack

Source-locked retouch

Paint details from contributing source frames onto the fused result. Auto background swaps a messy stacked background for one real frame and shows where no frame saw the scene clearly.

Retouch workspace with source frame and result

Batch processing

Process multiple stacks at once, with optional grouped fusion for large stacks.

Batch processing dialog

Publication scale bars

Add calibrated scale bars to images and exports.

Manual →

Scale bar dialog with a live preview

Captions and labels

Add styled labels and captions to source frames, aligned stacks, or results.

Label manager with a live preview

Agent-drivable

Control the desktop app through a token-protected local channel.

Protocol → · Skill →

An agent drives the live GUI: load, AI render, compare, retouch, wipe, depth, labels

Also in the box:

  • Workflow — stack browser, sharpness curve, original-pixel zoom and loupe, ROI and reusable settings.
  • Microscopy — 16-bit processing, TIFF Z-stacks, calibration and dust correction.
  • Image formats — supported transparent PNG stacks and ICC profile preservation.
  • Headless CLI — batch processing, reusable recipes, EXIF focus ordering, auto background and JSON output.
  • Projects and recovery — session files, undo/redo and crash recovery.
  • Languages — twelve UI languages with automatic locale detection.
  • Memory — bounded frame/tile work, disk-backed intermediates and neural models loaded only when selected.

OpenFocus A, B and C, Guided Filter, GFG-FGF, DCT and DTCWT are the stable fusion methods. StackMFF V4 requires Enable experimental features in Advanced Settings or --experimental in the CLI. For StackMFF V1/V2/V3, choose Enable legacy features or pass --legacy.

StackMFF V1–V4 run with the bundled ONNX Runtime. Settings → AI acceleration components can install TensorRT and PyTorch CUDA on compatible Windows NVIDIA systems, PyTorch CUDA on Linux NVIDIA systems, and PyTorch MPS on Apple Silicon. With GPU acceleration enabled, OpenFocus tries the installed native engine, then an available ONNX Runtime accelerator, then CPU. Diagnostics record the engine used by the model. See GPU support.

Neural inference adapts spatial tile size to available resources while keeping all focal frames in each inference. Imported frames and alignment scratch can use disk-backed storage. Large stacks still require enough free temporary disk space and available memory for decoding, model workspaces and full-size output; they may be rejected when those resources are insufficient. StackMFF V2's spatial tiling is an approximation of whole-image inference and can change the result. See fusion methods.

JPEG/RAW display previews use embedded data when available. Processing and original-pixel inspection decode the source independently; a small preview never replaces the pixels used for fusion. Keep enough free RAM and temporary disk space for the selected source, processing workspace and full-size result.

⬇️ Install

The OpenFocus website offers stable desktop builds for Windows x64, macOS Apple Silicon and Linux x86-64. Extract the Linux archive and run OpenFocus/OpenFocus. Desktop updates use the stable channel by default. Enable beta updates in Advanced Settings or the welcome dialog to receive newer prereleases. Linux desktop updates are installed manually from the download page. Desktop downloads · Release history

On macOS (Apple Silicon) or Linux, install from a terminal. On Linux this command installs the headless CLI; on macOS it installs the app in ~/Applications.

curl -fsSL https://openfocus.top/install.sh | sh

On Windows, run the installer from PowerShell:

irm https://openfocus.top/install.ps1 | iex

To download the Windows installer without running it:

curl.exe -fL https://openfocus.top/download/latest/windows-setup -o OpenFocus-setup.exe

For installation and first-launch help, see the user manual.

🤖 Agent integration

The desktop app starts a token-protected local agent channel automatically. Use openfocus ctl for typed commands or generic UI actions against the live window. Agents can load stacks, render, export, open and fill dialogs, answer file pickers, send mouse/keyboard events and take screenshots.

The pip install openfocus package is headless. To use its ctl command with a separately running desktop app, also install PyQt6 (pip install PyQt6). The wheel cannot launch the desktop app; use the desktop build or a checkout.

With --launch, these tools read the current desktop's saved sign-in or the one in --account-profile DIRECTORY. They start a private desktop profile, disable automatic reports and usage sharing, and remove the private copy of the credential after startup.

💻 Command Line Usage

Or install the CLI on Windows, macOS and Linux — the same pipeline, no GUI stack:

pip install openfocus
openfocus -i ./stack_folder -o ./result/fused.png

For unattended background replacement while retaining the original fusion and its missing-data map:

openfocus -i ./stack_folder -o ./result/fused.tif --auto-background auto --save-stacked --missing-data-map

Folder inputs use EXIF focus steps when every frame supplies them and the near-to-far step direction is known; otherwise they keep natural filename order. Use --frame-order name to force filename order; explicitly listed files retain their supplied order.

Recipes preserve native RAW conversion mode and batch output format. Run transient duplicate and alignment reports through direct CLI invocations.

See the CLI manual.

Community & Support

Questions, ideas or feedback? Scan the Discord QR code to join our community. We reply as soon as we can from Beijing (UTC+8).

Scan a QR code to join the OpenFocus Discord or WeChat group, or follow our official WeChat account.

WeChat group Official account Discord
QR code for the OpenFocus WeChat group QR code for the OpenFocus WeChat official account QR code to join the OpenFocus Discord community

Support OpenFocus: If you enjoy the software, you can buy us a coffee via Alipay in China or PayPal internationally. Include your username in the payment note and we will permanently acknowledge it in the project as a thank-you.

Alipay · China PayPal · International
Alipay QR code to support OpenFocus PayPal QR code with the PayPal mark; scan or click to support OpenFocus
Scan or click to donate via PayPal

License

The OpenFocus application is released under the Apache License, Version 2.0. See NOTICE. StackMFF components have their own license terms.

The retrained StackMFF V1 and V2 models, weights, and associated wrapper and inference code are governed by the StackMFF V3 License 1.0. The licensor's prior written permission is required to redistribute these components, including copies extracted from OpenFocus, to incorporate them into projects made available outside your organization, or to use them commercially.

The bundled original StackMFF V3 v2.0 snapshot is licensed under MIT. See THIRD_PARTY_NOTICES for full provenance and third-party license terms.

Developing

Run from a checkout:

conda create -n openfocus python=3.12
conda activate openfocus
pip install -r requirements.txt
python main.py

Install the shared development tools and run the regression suite:

python -m pip install -r requirements-dev.txt
python -m pytest -q --timeout=90 --timeout-method=thread

CI runs the full suite as consecutive slices, one pytest process per CPU core, which takes a fraction of the single-process time:

python tools/parallel_tests.py --timeout=180 --timeout-method=thread

Add --jobs N to use fewer processes than cores.

On a headless host, set QT_QPA_PLATFORM=offscreen. CI uses these same dependency files on Windows, macOS and Linux. A change to processing, cancellation or GUI state also needs a real CLI/desktop smoke run; tests alone do not exercise the packaged application.

Keep algorithm descriptors in core/algorithms.py, shared processing in core/utils, and UI snapshots/dialog orchestration in the controllers. New methods declare parameters, resource estimates and capabilities once; consumers derive their choices from that descriptor. Preserve bit depth, source order, cooperative cancellation and the admitted thread/RAM limits.

Packaging with PyInstaller: docs/BUILD_COMMANDS.md.

Adding a fusion or registration algorithm: CONTRIBUTING.md. The extensibility specification defines the shared registration, parameter, execution and persistence contracts.

⭐ Star History

Star History Chart

Metadata

Release files for openfocus 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openfocus 2.1.1
File Size Uploaded Provenance Actions
openfocus-2.1.1.tar.gz 59.3 MB Without provenance Details for openfocus-2.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for openfocus 2.1.1
File Actions
openfocus-2.1.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for openfocus-2.1.1-cp313-cp313-win_amd64.whl
openfocus-2.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for openfocus-2.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
openfocus-2.1.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for openfocus-2.1.1-cp313-cp313-macosx_11_0_arm64.whl
openfocus-2.1.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for openfocus-2.1.1-cp312-cp312-win_amd64.whl
openfocus-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for openfocus-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
openfocus-2.1.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for openfocus-2.1.1-cp312-cp312-macosx_11_0_arm64.whl
openfocus-2.1.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for openfocus-2.1.1-cp311-cp311-win_amd64.whl
openfocus-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for openfocus-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
openfocus-2.1.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for openfocus-2.1.1-cp311-cp311-macosx_11_0_arm64.whl
openfocus-2.1.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for openfocus-2.1.1-cp310-cp310-win_amd64.whl
openfocus-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for openfocus-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
openfocus-2.1.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for openfocus-2.1.1-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 159.9 MB

Release files / openfocus-2.1.1.tar.gz

Download URL openfocus-2.1.1.tar.gz
Size 59.3 MB
Tags Source
SHA-256 checksum
How to use checksums
31515551987a58b45894f1648d1232f940f75937491eb5d2904579fb15e3c6e6
BLAKE2b-256 checksum
How to use checksums
6ed71e40d74f599590960dc06636be93b24d68f7b0f46427ceb8e58fb0453bef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp313-cp313-win_amd64.whl

Download URL openfocus-2.1.1-cp313-cp313-win_amd64.whl
Size 8.3 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
4b9ee0561da89ff716f068987f56313d057b3b7757deab4f6fa8bf5e3e2e6b64
BLAKE2b-256 checksum
How to use checksums
c85d26db6f40ebbb612727448d72f100b818e0a62b5a92ee54abc4b35c79f8ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL openfocus-2.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 8.5 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
070a8c4cbeee26d35378688e40eb0242640bcd86db6044414e03548d873235da
BLAKE2b-256 checksum
How to use checksums
22e74027654912141dee08b3bd5af7e76e7566b1683d0b6a58c1abe22f575705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL openfocus-2.1.1-cp313-cp313-macosx_11_0_arm64.whl
Size 8.3 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
49ced786911dfa59fb4c42abaabf81973e9c9ce2e6c82a51324c365027e1fa95
BLAKE2b-256 checksum
How to use checksums
4c3975fc41979ff138b20f101141eb544092f52faf60c8a3b5567ed852db1c24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp312-cp312-win_amd64.whl

Download URL openfocus-2.1.1-cp312-cp312-win_amd64.whl
Size 8.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6a202f3ff0e4a716f739bf3d1c757437e0db420ed7247e5545cdf248672f2d5c
BLAKE2b-256 checksum
How to use checksums
041226f25f149f811bee859d5e76319da38fa2de69161717303b243552ad36d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL openfocus-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 8.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2906fd899206d19461e3754e5ab7e1b9fecc80edca1a5e36a5149eb1bcd0765e
BLAKE2b-256 checksum
How to use checksums
1df964b95932cd07a2c160887b454b4c487d5b67ef13b83403ebbff39fdb6507
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL openfocus-2.1.1-cp312-cp312-macosx_11_0_arm64.whl
Size 8.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ca59773abe5c798d890aa119580952e1d0afe6ebdbf943126dea045e5aefd0e1
BLAKE2b-256 checksum
How to use checksums
91f01e977987b219f4191ae99d6f45848b59b6f248e21d64e8037a318bc23f0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp311-cp311-win_amd64.whl

Download URL openfocus-2.1.1-cp311-cp311-win_amd64.whl
Size 8.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
012802d393d0e445a78a2b30186489982bee46a3a0f5d6992640733a76892625
BLAKE2b-256 checksum
How to use checksums
fc06f0de78265a2c53fe37f9a57d5c39a980477284f825750738417460b893f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL openfocus-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 8.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cb96a1e3bca052f074bd2aae4aafb4da0a873c9eaad37cc421364589520b23ad
BLAKE2b-256 checksum
How to use checksums
184144e5187730b3c121cde2b2bdc880c4d44f93f024e4e6e8c45e4d91412e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL openfocus-2.1.1-cp311-cp311-macosx_11_0_arm64.whl
Size 8.3 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
33badf495ef93bb91cc8ec4610c7ae728a243d404b4f66cb87b9257931fa3848
BLAKE2b-256 checksum
How to use checksums
ffb03f09658c78cf9086ee5f76f61fad7b0db3aeb757ea5a75f819af6b753d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp310-cp310-win_amd64.whl

Download URL openfocus-2.1.1-cp310-cp310-win_amd64.whl
Size 8.3 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
f60cf1e21fa12bd09bb36926f6ccfe459d3ad96f27c53903cd7c9f99f0ec4f5c
BLAKE2b-256 checksum
How to use checksums
5a83624b2a41cd46c2d0cc115dc0c9d64c3ad80ccaf41c8e800c5363138ed722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL openfocus-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 8.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e9a1025b2597baf75b44beb85f93dcebb297c55bb5da60f8fea00818be821913
BLAKE2b-256 checksum
How to use checksums
3355f9d51dde0ed99bbac7be288416a92b09ff3fbbb083bda773662a4a64f5eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / openfocus-2.1.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL openfocus-2.1.1-cp310-cp310-macosx_11_0_arm64.whl
Size 8.3 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d19a5fa07f4bc52e5a0982412c8c27a104c18d39c4d9f0e7bf52badb4552e5c2
BLAKE2b-256 checksum
How to use checksums
25533a15feab98b43e310a95088accfb2af03e9243d357c32b15676b8582da6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for openfocus 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.1 This release

13 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page