Skip to main content

An intelligent image enhancement tool inspired by Renaissance techniques

Project description

Chiaroscuro Forge

PyPI version PyPI downloads PyPI Downloads Python versions License Tests codecov Code style: black DOI

An intelligent image enhancement tool inspired by Renaissance techniques. Features automatic parameter detection, advanced color preservation, quality metrics, and parallel batch processing. Perfect for photographers and developers seeking to transform ordinary images with artistic precision.

Features

  • Intelligent Enhancement: Automatically analyzes image characteristics and applies optimal processing parameters
  • Advanced Color Preservation: Maintains color fidelity while enhancing contrast and details
  • Multiple Enhancement Methods: LAB, RGB, and ratio-based color processing modes
  • Quality Metrics: Calculates SSIM, PSNR, MS-SSIM, and other perceptual quality scores
  • Batch Processing: Process multiple images in parallel with detailed reporting
  • Preset System: Save and reuse customized enhancement settings
  • Application Types: Specialized processing for photography, documents, medical images, and art

Installation

Requirements

  • Python 3.7+
  • NumPy
  • SciPy
  • scikit-image

Install from PyPI

pip install chiaroscuro-forge

After installing, the CLI entrypoint is available as:

chiaroscuro-forge --help

Install from source

git clone https://github.com/MichailSemoglou/chiaroscuro-forge.git
cd chiaroscuro-forge
pip install -e .

Quick Start

Process a single image

chiaroscuro-forge input.jpg --output enhanced.jpg

Analyze an image and suggest parameters

chiaroscuro-forge input.jpg --analyze

Process multiple images in batch mode

chiaroscuro-forge "images/*.jpg" --output processed/ --batch

Create and use presets

# Save parameters as preset
chiaroscuro-forge input.jpg --analyze --save-preset my_preset

# Use preset to process images
chiaroscuro-forge input.jpg --output enhanced.jpg --preset my_preset

Command-Line Options

Input/Output

  • image_path: Path to input image or glob pattern for batch processing
  • --output, -o: Path for output image or directory for batch processing
  • --batch, -b: Enable batch processing mode

Processing Parameters

  • --application, -a: Application type (general, photography, medical, document, art)
  • --preset: Name of a preset to use

Analysis Options

  • --analyze: Analyze image and suggest parameters
  • --analyze-batch: Analyze multiple images and suggest optimal parameters
  • --compare: Compare different processing methods
  • --compare-dir: Output directory for comparison results

Preset Management

  • --save-preset: Save parameters as a preset
  • --list-presets: List all available presets
  • --preset-description: Description for the preset

Batch Processing Options

  • --workers, -w: Number of parallel workers (default: 4)
  • --skip-existing: Skip files that have already been processed
  • --report: Generate a JSON report with processing results
  • --log-file: Path to log file for batch processing

Examples

Basic Enhancement

chiaroscuro-forge photo.jpg --output enhanced.jpg

Custom Application Type

chiaroscuro-forge document.jpg --output enhanced.jpg --application document

Analyze and Process

chiaroscuro-forge photo.jpg --analyze --output enhanced.jpg

Compare Processing Methods

chiaroscuro-forge photo.jpg --compare

Batch Processing with Report

chiaroscuro-forge "photos/*.jpg" --output enhanced/ --batch --workers 8 --report

Python API

You can use Chiaroscuro Forge directly in your Python code:

Get Image Statistics

from chiaroscuro_forge import get_image_statistics

stats = get_image_statistics("photo.jpg")
print(f"Dimensions: {stats['dimensions']}")
print(f"Brightness: {stats['brightness']:.2f}")
print(f"Dynamic range: {stats['dynamic_range']:.2f}")
print(f"Contrast ratio: {stats['contrast_ratio']:.2f}")

Process an Image

from chiaroscuro_forge import process_image

processed, metrics = process_image(
    "input.jpg",
    output_path="enhanced.jpg",
    application_type="photography"
)
print(f"SSIM: {metrics['ssim']:.4f}")
print(f"PSNR: {metrics['psnr']:.2f} dB")

Analyze Image Characteristics

from chiaroscuro_forge import analyze_image_characteristics

analysis = analyze_image_characteristics("photo.jpg")
print(f"Suggested parameters: {analysis['suggested_params']}")

Development

The project is structured around core image processing functions with a focus on quality and customizability:

  • get_image_statistics(): Returns comprehensive image statistics (dimensions, intensity, histogram, dynamic range, contrast)
  • analyze_image_characteristics(): Extracts characteristics from images
  • process_image(): Main processing function with numerous customizable parameters
  • compare_processing_methods(): Compares different enhancement approaches
  • batch_process_images(): Handles processing of multiple images

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

chiaroscuro_forge-0.3.0.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

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

chiaroscuro_forge-0.3.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file chiaroscuro_forge-0.3.0.tar.gz.

File metadata

  • Download URL: chiaroscuro_forge-0.3.0.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for chiaroscuro_forge-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d8dfe5523a5cfe137e8ae3e7af0fb9805f5f0ae1879086f72f32f7494dfe5450
MD5 9f08f08c6df42ca57f41c312d3931f97
BLAKE2b-256 bde48838cf411fcf045f2740a8522897cdf0c4d224b6e5bac2ae4747d7cabcab

See more details on using hashes here.

File details

Details for the file chiaroscuro_forge-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chiaroscuro_forge-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9ebb6495026185ef993057e719c2ece63ee015b6d16a7f9c70af074d1cfeda7
MD5 e59979c3417db5561b4d40e71b1746d6
BLAKE2b-256 064ae791efa8b8204d3d1850a383e5b5a53c19f900318355542ca46a03775682

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