Skip to main content

A Python package for digital image processing

Project description

barc4dip

barc4dip is a Python package for digital image processing, with a focus on scientific images and beam diagnostics.

It provides utilities for image I/O, preprocessing, signal analysis, plotting, and compact reporting, with current emphasis on speckle and sharpness metrics for 2D images and image stacks.


Features

  • Read and write scientific images (TIFF, EDF, HDF5)
  • Compute image statistics and distribution moments
  • Compute speckle metrics on single images and stacks
  • Compute sharpness metrics on single images and stacks
  • Apply basic preprocessing tools such as flat-field correction and PSF deconvolution
  • Perform FFT / PSD / correlation / translation tracking operations
  • Plot images, histograms, tile maps, stack metrics, and displacements
  • Export compact Markdown logbook reports
  • Run a small CLI for speckle-image reporting

Installation

Local installation from source:

git clone https://github.com/barc4/barc4dip.git
cd barc4dip
pip install -e .

pip install barc4dip is planned, but not available yet.


Main modules

  • barc4dip.io – image reading and writing
  • barc4dip.preprocessing – flat-field correction, deconvolution
  • barc4dip.metrics – speckle, sharpness, and distribution metrics
  • barc4dip.signal – FFT, PSD, correlation, and tracking helpers
  • barc4dip.plotting – plotting API for images and stack metrics
  • barc4dip.report – Markdown logbook summaries
  • barc4dip.geometry / maths / utils – supporting tools

Quick example

import barc4dip as dip

img = dip.read_image("image.tif")
stats = dip.sharpness_stats(img)
report = dip.logbook_report(stats)

print(stats["full"])
print(report)

For stacks:

import barc4dip as dip

stack = dip.read_image("scan.h5")
stats = dip.sharpness_stack_stats(stack)

Command line

A small CLI is currently available for speckle-image analysis:

barc4dip-speckles -s speckles.tif -o report.md

Optional flat and dark images can also be provided.


Status

This project is under active development.

  • PyPI distribution: coming soon
  • More examples: coming soon
  • Full documentation: coming soon

The repository already contains early notebooks and generated report examples that illustrate the intended workflow.


License

CeCILL-2.1

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

barc4dip-2026.3.31.tar.gz (82.4 kB view details)

Uploaded Source

Built Distribution

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

barc4dip-2026.3.31-py3-none-any.whl (102.9 kB view details)

Uploaded Python 3

File details

Details for the file barc4dip-2026.3.31.tar.gz.

File metadata

  • Download URL: barc4dip-2026.3.31.tar.gz
  • Upload date:
  • Size: 82.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for barc4dip-2026.3.31.tar.gz
Algorithm Hash digest
SHA256 9f92e867775482d9aad57948eab4cdb07a9472cf70f87aa0484b1174c304bbec
MD5 29e77006c80e289cd81bc5b1f1b209cb
BLAKE2b-256 618089ebdcbf70ebcdbb8f5f20bd5cb3b4f10876dab9e179370f9bb3aac3005f

See more details on using hashes here.

File details

Details for the file barc4dip-2026.3.31-py3-none-any.whl.

File metadata

  • Download URL: barc4dip-2026.3.31-py3-none-any.whl
  • Upload date:
  • Size: 102.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for barc4dip-2026.3.31-py3-none-any.whl
Algorithm Hash digest
SHA256 3f6f6dbb3a9437a6d1dc96afa76289a3efd50b6de481535a857ca3d1a7797a07
MD5 f6995359b378179e0038f4efd53d1f0e
BLAKE2b-256 d2f351ce8178126a4209013667be8c7727fc09a8c74e9517f86443293bf36857

See more details on using hashes here.

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