Lume is a command-line interface (CLI) tool designed for batch image brightness and contrast correction.
- 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.
- Clone the repository and ensure you have Python 3.9+ installed.
- Install dependencies:
pip install -r requirements.txt- Run the script:
python lume.py --help- Download
lume.exe. - (Optional) Add the folder containing
lume.exeto your System PATH to run it from any directory.
# 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 | Description | Parameters |
|---|---|---|
view |
Batch viewer for original images (No editing). | N/A |
line |
Linear adjustment ( |
--alpha (Contrast), --beta (Brightness) |
pow |
Gamma correction ( |
--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 |
-a,--auto: Enable automatic histogram normalization.-p,--preview: Open interactive viewer.-s,--save: Save current parameters as yourfastpreset.-o,--output: Specify output filename (for single-file input only).
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
viewmode). - Esc / Q: Close the viewer and return to terminal.
The project includes a comprehensive test suite using unittest and unittest.mock.
To run all tests:
python -m unittest test_lume.py- rasterio: Robust image I/O and metadata handling.
- numpy: High-speed matrix calculations.
- matplotlib: Interactive GUI and rendering.
- tqdm: Multi-threaded progress bars.