Skip to main content

Viewer for monochromatic video data

Project description

Monochrome: Viewer for Monochromatic Video Data

docs tests PyPI Supported Python versions

Monochrome is a lightweight and fast viewer for scientific imaging and video data with a focus on monochromatic data and high-dynamic range data. It is designed to be fast and lightweight, i.e. it uses memory-mapping to load video files to avoid copying the data into RAM.

Monochrome

It is designed for viewing high-speed monochromatic fluorescence video data from scientific cameras and meet our specific needs for cardiac optical mapping data (together with optimap):

  • Support for high-dynamic range (uint16, 32-bit float) data with sliders to adjust intensity range
  • Playback of multiple videos in sync
  • High-speed playback with precise frame-rate control
  • Viewing of optical traces (average intensity in a region of interest over time)
  • Rendering of layers on top of videos with transparency
  • Rendering of point positions over time (e.g. for tracking or optical flow visualization)
  • Exporting videos as a sequence of PNG images or MP4 videos with control over frame rate and frame skipping
  • Cross-platform (Linux, Windows, MacOS)

It is designed to be fast and lightweight, i.e. it uses memory-mapping to load video files to avoid copying the data into RAM.

Installation

There are two ways to install Monochrome: as a standalone application and/or with its Python interface through pip.

In the standalone application, supported video files can be loaded by drag & drop them into the window or by associating the file extension with Monochrome to open them with a double-click. The Python interface allows to load and play videos from Python scripts and Jupyter notebooks.

Standalone Application

Download the relevant executable (Windows, macOS, or Linux) from the latest release page. See the installation instructions for details.

Python Library

The Python library includes all necessary files and does not require the installation of the standalone Monochrome application. Open a terminal window and run the following command:

python -m pip install monochrome

See the Python installation guide for further details. To start the viewer in standalone mode, run:

python -m monochrome

See the tutorial for an introduction to the Python library, here is a brief overview:

import monochrome as mc
import numpy as np

# Create some video with shape (time, height, width) as a numpy array
video = np.random.rand(500, 256, 256)

# Display the video, see the tutorial for more details and options.
# Monochrome should automatically start and show the video in a loop.
mc.show_video(video, name="First Video", cmap='viridis', vmin=0, vmax=1)

# Play second video in sync with the first (note that the videos should have the same length)
video2 = (np.random.rand(500, 256, 256) * 65535).astype(dtype=np.uint16)
mc.show_video(video2, name="Second Video", comment="This is a uint16 video", bitrange="uint16")
# `bitrange` argument is optional, Monochrome will auto-detect the data type

# Layers can be added on top of video
overlay = np.random.rand(500, 256, 256)
overlay[:, 64:192, :] = np.nan # NaN values will be transparent pixels, see tutorial
mc.show_layer(overlay, parent="Second Video", cmap='PRGn', opacity='centered')

# List of functions:
# mc.show() is a shortcut for mc.show_video()/show_layer()/show_image()/show_file(),
#           it will try to auto-detect the input type and call the appropriate function.
# mc.show_video() to show videos
# mc.show_image() to show single images
# mc.show_layer() to show layers on top of videos/images
# mc.show_points() to visualize point positions over time over videos
# mc.show_flow() to visualize optical flow fields over time
# mc.show_file() to load videos from file in Monochrome
# mc.close_video() to close a video/layer/image
# mc.export_video() export a window (video+layers+...) as a MP4 video
# mc.launch() to start Monochrome from Python
# mc.quit() to close Monochrome

Supported File Formats

Monochrome supports a wide range of file formats through both native handlers and a plugin system.

Native File Handlers

  • .tif, .tiff - TIFF image files (single or multi-page)
  • Directory of TIFF files - Loads a directory containing TIFF images as a single video
  • .npy - NumPy array with shape (time, height, width). The data type can be float (np.float32, np.float64), integer (uint8, uint16, etc.), or boolean.
  • .dat - Raw binary file with shape (time, height, width) and data type float32 or MultiRecorder file format (used in the cardiac optical mapping community)

Plugin-Based File Handlers

Monochrome uses a plugin system to support additional file formats:

  • Image Formats: .png, .jpg, .jpeg, .webp, .bmp, .pgm
  • TIFF Variants: .tf8, .ptif, .ptiff, .lsm (ZEISS LSM), .btf, .bif (Roche Digital Pathology), .gel, .ndpi (Hamamatsu Slide Scanner), .stk, .qptiff (Perkin Elmer Vectra)
  • Medical Imaging: .dcm, .dicom, .gdcm, .gipl, .hdf5, .hdr, .ipl, .img, .img.nz, .mgh, .mha, .mhd, .mnc, .mnc2, .nhdr, .nia, .nii, .nii.gz, .nrrd, .vtk
  • Video Formats: .mp4, .avi, .webm, .mov, .mkv, .gif, .wmv, .m4v
  • MATLAB: .mat
  • MiCAM Formats: .gsd, .gsh, .rsh, .rsm, .rsd (MiCAM camera formats)

Drag & drop files into the window or associate the file extension with Monochrome to open them with a double-click. Required plugin dependencies will be downloaded automatically when opening files that need them.

Usage & Key Bindings

Adjust settings for each video in the main control window. To view optical traces (average intensity in a region of interest over time), click in a video. Click and drag to move the region of interest. Right-click to remove the region of interest.

Keyboard shortcuts:

Keybinding         Action               
Ctrl + q Quit Monochrome
Esc or q Close focused recording
Ctrl + o Open media file
Ctrl + Shift + o Open png/tiff/dcm file folder
Space Play/Pause
Up Increase playback speed (frame skip)
Down Decrease playback speed (frame skip)
0 or r Reset playback to beginning
Left Skip to next frame
Right Skip to previous frame
Shift + Left 10x previous frame
Shift + Right 10x next frame
Ctrl + Left Previous frame in focused recording only
Ctrl + Right Next frame in focused recording only
Ctrl + Left + Shift 10x previous frame in focused recording only
Ctrl + Right + Shift 10x next frame in focused recording only
p Save screenshot of focused recording
s Sync playback of all recordings

Additional Resources

License

Monochrome is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monochrome-2025.9.11.tar.gz (10.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

monochrome-2025.9.11-py3-none-win_amd64.whl (2.5 MB view details)

Uploaded Python 3Windows x86-64

monochrome-2025.9.11-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.8 MB view details)

Uploaded Python 3manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

monochrome-2025.9.11-py3-none-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

monochrome-2025.9.11-py3-none-macosx_10_9_x86_64.whl (3.4 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file monochrome-2025.9.11.tar.gz.

File metadata

  • Download URL: monochrome-2025.9.11.tar.gz
  • Upload date:
  • Size: 10.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for monochrome-2025.9.11.tar.gz
Algorithm Hash digest
SHA256 504fccfe4c4e18183db9ed123455468169a4ef73e72e43044ad43229a6849e89
MD5 c329680a8c59357e397e467633ed69cd
BLAKE2b-256 f75cc51a695b44a8508f2629e8e88e39bcaff9a318d2f509e269cb4802137a2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for monochrome-2025.9.11.tar.gz:

Publisher: build.yml on sitic/monochrome

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file monochrome-2025.9.11-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for monochrome-2025.9.11-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 91fbebeb3aff560336018e5a021443e6e8d9cf3df5922fc4d05f0076307e90a9
MD5 17cb3bb6c55405d09abad1d518381256
BLAKE2b-256 17bf03bb6464286cacf4c7e153f4db87f10c44332d9ca4db64d3714bc9756d39

See more details on using hashes here.

Provenance

The following attestation bundles were made for monochrome-2025.9.11-py3-none-win_amd64.whl:

Publisher: build.yml on sitic/monochrome

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file monochrome-2025.9.11-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for monochrome-2025.9.11-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f1d576e02b1e6ed6769d7670b4dcb71dda8a843414a15c8f833527b9b4c2fa86
MD5 ffa9ca7a65897cfba9b934f9cd4700fd
BLAKE2b-256 3350440c6f43e7e7d892f8d78e21b18f432333f572bf541ad49df9dacc1872d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for monochrome-2025.9.11-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on sitic/monochrome

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file monochrome-2025.9.11-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for monochrome-2025.9.11-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4b23cba83f5eb1e7ced0b2e73e1bf5f40a1911b0ac8cc5776a27a121fcd1eda
MD5 69eedc6f11d9cdd3d3e67abe4c5a999e
BLAKE2b-256 e7ebfc6844686a9c61d691df52559ccf43ae05629bc0b21ed4b69395a8a3098b

See more details on using hashes here.

Provenance

The following attestation bundles were made for monochrome-2025.9.11-py3-none-macosx_11_0_arm64.whl:

Publisher: build.yml on sitic/monochrome

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file monochrome-2025.9.11-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for monochrome-2025.9.11-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e2ca0f83b08663a531e462f4c77c7d8462b3ffd77d5388c7c82d3599821a7ab1
MD5 e53cc055d23aabb4ad83cf23810ca654
BLAKE2b-256 281a643a407f8c7e64549d852c0f093f7adb5c0c779eb387d169355041ce7bcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for monochrome-2025.9.11-py3-none-macosx_10_9_x86_64.whl:

Publisher: build.yml on sitic/monochrome

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page