Skip to main content

SHINIER

   ███████╗██╗  ██╗██╗███╗  ██╗██╗███████╗██████╗
   ██╔════╝██║  ██║██║████╗ ██║██║██╔════╝██╔══██╗
   ███████╗███████║██║██╔██╗██║██║█████╗  ██████╔╝
   ╚════██║██╔══██║██║██║╚████║██║██╔══╝  ██╔══██╗
   ███████║██║  ██║██║██║ ╚███║██║███████╗██║  ██║
   ╚══════╝╚═╝  ╚═╝╚═╝╚═╝  ╚══╝╚═╝╚══════╝╚═╝  ╚═╝

Spectrum, Histogram, and Intensity Normalization, Equalization, and Refinement.

License: BSD-3-Clause Python versions PyPI version Documentation Status DOI Tests

Overview

SHINIER is a modern Python implementation of SHINE (Spectrum, Histogram, and Intensity Normalization and Equalization), originally developed in MATLAB by Willenbockel et al., 2010. It provides precise control over luminance, contrast, histograms, and spectral content across large image sets for well-calibrated visual experiments.

Full documentation, API reference, and demos: shinier.readthedocs.io

Paper: SHINIER (SoftwareX, 2026)

Key Features and Improvements

  • Color Processing — New modes for color image control with modern color-space standards (Rec.601 / Rec.709 / Rec.2020).
  • Dithering Support — Reduces quantization artifacts and enhances output image quality.
  • Optimized Performance — Efficient memory management and faster processing for large image sets (optional Cython/C++ convolution core).
  • Legacy Mode — Ensures full backward compatibility with MATLAB’s original SHINE toolbox.
  • High-Precision Arithmetic — Computations in floating-point precision rather than 8-bit integer space, minimizing rounding errors in multi-stage processing.
  • Object-Oriented Design — Modular, extensible architecture with a clean Python API.
  • User-Friendly CLI — Guided, prompt-based interface for users who prefer not to write code.

For detailed technical documentation (algorithms, numerical choices, and MATLAB vs Python behavior), see
documentation/documentation.md.


Quick Start

Installation

Pip Install (recommended):

pip install shinier

Note: SHINIER includes a Cython-compiled C++ extension (_cconvolve) for faster convolution. If a C/C++ compiler is available, it will build automatically during installation, otherwise, it will fall back to a slower NumPy-based implementation.

Install compilers:

macOS: xcode-select --install 

Linux: sudo apt install build-essential 

Windows: Visual Studio C++ Build Tools

Install from source (development version):

git clone https://github.com/Charestlab/shinier.git
cd shinier
pip install -e ".[dev]"

Verify the install:

import shinier, sys
print("shinier version:", getattr(shinier, "__version__", "unknown"))

User-friendly Interface

Call the following bash command to quickly start using the interactive CLI.

shinier --show_results --image_index=1

CLI demo

Example in Python

Run the following python code to make sure the package is running properly.

from shinier import Options, ImageDataset, ImageProcessor, utils

opt = Options(mode=3)  # Spatial frequency matching
dataset = ImageDataset(options=opt)
results = ImageProcessor(dataset=dataset, options=opt, verbose=1)
_ = utils.show_processing_overview(processor=results, img_idx=0)

Processing modes

Change the mode number (e.g. opt = Options(mode=3)) to change image processing. See details below:

Mode Operations Description
1 lum_match Luminance (mean/std) matching
2 hist_match Histogram matching
3 sf_match Rotational spatial frequency matching
4 spec_match Full 2D Fourier spectrum matching
5 hist_match → sf_match Histogram, then spatial frequency
6 hist_match → spec_match Histogram, then spectrum
7 sf_match → hist_match Spatial frequency, then histogram
8 spec_match → hist_match (default) Spectrum, then histogram (recommended)
9 ie_methods or dithering Standalone per-image transform (histogram-derived enhancement or dithering)

Below is an example of results obtained using mode 5 with joint histogram equalization and spatial frequency normalization.

CLI demo


Technical information

Documentation:

  1. Package Overview
  2. Package Architecture
  3. MATLAB vs Python Differences
  4. Detailed Processing Modes
  5. Border Artifacts and FFT Padding
  6. Package Main Classes
  7. StimulusMasker
  8. Visualization Functions
  9. Implemented Algorithms
  10. Memory Management and Performance
  11. Testing and Validation
  12. Usage Demonstrations
  13. Additional Resources

Citing

If you use SHINIER, please cite both of these articles:

References

  • Salvas-Hébert, M., Dupuis-Roy, N., Landry, C., Charest, I., & Gosselin, F. (2026). SHINIER: An open-source Python package for controlling low-level image properties. SoftwareX, 35, Article 102884. https://doi.org/10.1016/j.softx.2026.102884
  • Willenbockel, V., Sadr, J., Fiset, D., Horne, G. O., Gosselin, F., & Tanaka, J. W. (2010). Controlling low-level image properties: The SHINE toolbox. Behavior Research Methods, 42(3), 671–684. https://doi.org/10.3758/BRM.42.3.671

Contributing

See CONTRIBUTING.md for guidelines (coding standards, tests, docs, and PR flow).


License

See LICENSE for more information.


Troubleshooting

  • No compiler available: install a C/C++ toolchain or proceed with the NumPy fallback (slower).
  • Compiled extension fails to load (e.g., NumPy too old / ABI mismatch): SHINIER warns and uses the NumPy fallback; upgrade NumPy (and pip/setuptools/wheel) and reinstall to restore the compiled core.
  • Import errors after upgrade: try pip install --upgrade pip setuptools wheel and reinstall.
  • Windows build issues: ensure MSVC Build Tools are installed and on PATH.

Code developed by Nicolas Dupuis-Roy and Mathias Salvas-Hébert
Version 0.2.3 - Complete technical documentation

Release files for shinier 0.2.3

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

Source distribution (sdist)

Source distribution for shinier 0.2.3
File Size Uploaded
shinier-0.2.3.tar.gz 10.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for shinier 0.2.3
File Interpreter ABI Platform
shinier-0.2.3-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details

Total release size: 11.6 MB

Release files / shinier-0.2.3.tar.gz

Download URL shinier-0.2.3.tar.gz
Size 10.3 MB
Tags Source
SHA-256 checksum
How to use checksums
d611856e2a752c7caf78241e1b656971517a08f73b9c7fe6575f238e82849367
BLAKE2b-256 checksum
How to use checksums
54eb8e4bbf85a1cd7cf8c9287797c954e473ef20af80c1dea37b0ccc136f8c35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / shinier-0.2.3-cp312-cp312-macosx_11_0_arm64.whl

Download URL shinier-0.2.3-cp312-cp312-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c93c4da04cdde5d5325164072a6dd6c556780afe1521d94ca536778cb6796e40
BLAKE2b-256 checksum
How to use checksums
42df3532e5060ca0a456678d2f9821194f40456ee37638c1658d52099d2c2743
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

3 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

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