Inspiration

Professional photography is currently split into two worlds: the high-data "flat" world of RAW files and the instant-gratification world of AI filters. Most automated tools simply slap a filter on a JPEG, losing the 14-bit depth of professional sensors.

I wanted to create a tool that respects the sensor data while acting as a "Creative Director"—using Gemini 3 Flash’s reasoning to understand the intent of a photo before even touching a slider.

What it does

Midas Chroma is an AI-powered digital darkroom. It ingests professional RAW formats and JPEGs, analyzes the "vibe" and technical qualities of the shoot, and applies sophisticated, non-destructive color grading.

  • Agentic Vision Analysis: It combines local statistical analysis with Gemini 3 Flash’s vision to perform iterative inspections—zooming in on shadows to check for noise and verifying color accuracy.
  • Smart Denoise: It calculates noise levels mathematically to decide whether to use a Bilateral or FastNlMeans filter based on the sensor's raw data.
  • Melanin Reflector: A custom logic gate that ensures skin tones remain luminous and accurate, even under heavy cinematic color grades.

How I built it

The core engine is built in Python 3.12, leveraging a multimodal architecture:

  1. The RAW Engine: Using rawpy, I built a pipeline to tap into 14-bit data (CR2, NEF, ARW), providing a much wider dynamic range than standard tools.
  2. Multimodal Logic: I integrated the Gemini 3 Flash API to perform "Shoot Analysis" using thinking_level parameters to determine the set's aesthetic context.
  3. Computer Vision: OpenCV and Pillow handle noise estimation using Laplacian variance:\(\text{Noise Level} = \sigma^{2}(\nabla^{2} I)\)
  4. Real-Time Monitoring: I built a background process with the google-genai Live SDK to monitor the editing logic in real-time.

Challenges I ran into

  • Strict Type Validation: The 2026 Gemini SDK requires strict Pydantic validation. I had to pivot to formal types.LiveClientMessage objects to keep vision loops stable.
  • The "Melanin" Masking: Initially, warming up shadows turned teeth and eyes orange. I resolved this by building a secondary luminosity mask to target skin-adjacent frequencies.

What's next for Midas Chroma

  • Batch Consistency 2.0: Moving to Gemini 3 Pro for a 2-million-token context window to analyze entire galleries at once.
  • Video Support: Applying RAW logic to Log-format video files using Gemini 3's temporal reasoning.

Built With

  • asyncio
  • gemini-3-flash-preview
  • google-genai
  • json
  • mss-(screen-capture)
  • numpy
  • numpy-data-tracking-pydantic-(for-type-safety)
  • opencv-(cv2)
  • pillow-(pil)
  • pydantic-(for-type-safety)
  • python
  • rawpy
  • rawpy-(libraw)-system-&-i/o-asyncio
  • rawpy-(libraw-wrapper)-system:-mss-(screen-capture)
Share this project:

Updates