Skip to content

HC-NC/lume

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lume 💡

Lume is a command-line interface (CLI) tool designed for batch image brightness and contrast correction.

✨ Key Features

  • Batch Processing: Handle hundreds of images using wildcards (e.g., *.jpg).
  • Interactive Preview: Visualize adjustments in real-time before saving.
  • Multi-Algorithm: Support for Linear, Power-law (Gamma), Logarithmic, and Exponential transformations.
  • Auto-Normalization: Built-in histogram stretching for instant "auto-contrast."
  • Multilingual: Support for English and Russian interfaces.

🛠 Installation

From Source (Python)

  1. Clone the repository and ensure you have Python 3.9+ installed.
  2. Install dependencies:
pip install -r requirements.txt
  1. Run the script:
python lume.py --help

Compiled Executable (Windows)

  1. Download lume.exe.
  2. (Optional) Add the folder containing lume.exe to your System PATH to run it from any directory.

🚀 Quick Start

Basic Commands

# View images in a folder without editing
python lume.py view "assets/*.png"

# Apply Gamma correction (1.5) to all JPEGs with Auto-contrast
python lume.py pow *.jpg --gamma 1.5 --auto

# Interactive Preview (opens a window to see results)
python lume.py log photo.tif --base 10 -p

# Change interface language to Russian
python lume.py config --lang ru

📖 Command Reference

Command Description Parameters
view Batch viewer for original images (No editing). N/A
line Linear adjustment ($y = \alpha x + \beta$). --alpha (Contrast), --beta (Brightness)
pow Gamma correction ($y = x^\gamma$). --gamma
log Logarithmic compression (dark detail recovery). --base (Log base)
exp Exponential transformation. --alpha (Steepness)
neg Inverts image colors (Negative). N/A
fast Uses saved settings from config.json. N/A

Global Flags

  • -a, --auto: Enable automatic histogram normalization.
  • -p, --preview: Open interactive viewer.
  • -s, --save: Save current parameters as your fast preset.
  • -o, --output: Specify output filename (for single-file input only).

🎹 Interactive Controls (Preview/View Mode)

When using the -p flag or the view command, a window appears with these controls:

  • Left / Right Arrows / Space: Switch between images in the batch.
  • S: Save the currently displayed (processed) image. (Disabled in view mode).
  • Esc / Q: Close the viewer and return to terminal.

🧪 Testing

The project includes a comprehensive test suite using unittest and unittest.mock.

To run all tests:

python -m unittest test_lume.py

📚 Technical Stack

  • rasterio: Robust image I/O and metadata handling.
  • numpy: High-speed matrix calculations.
  • matplotlib: Interactive GUI and rendering.
  • tqdm: Multi-threaded progress bars.

About

A lightweight CLI tool for automated image brightness and contrast enhancement

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages