perf: Chain preprocessing pipeline in-memory instead of disk I/O #24

Closed
opened 2026-06-10 05:45:52 +00:00 by Mark · 0 comments
Owner

Problem

raster_converter.py:756-783 — preprocess_image() calls denoise(), remove_islands(), and quantize_colors sequentially. Each step writes an intermediate image to disk, then the next step re-opens it. ~72MB of unnecessary disk I/O per run.

Proposed Fix

Refactor to pass PIL Image objects in-memory between steps.

Impact

3-5x faster preprocessing pipeline.

Files

  • src/raster/raster_converter.py:741-783
## Problem `raster_converter.py:756-783` — `preprocess_image()` calls `denoise()`, `remove_islands()`, and `quantize_colors` sequentially. Each step writes an intermediate image to disk, then the next step re-opens it. ~72MB of unnecessary disk I/O per run. ## Proposed Fix Refactor to pass PIL Image objects in-memory between steps. ## Impact 3-5x faster preprocessing pipeline. ## Files - `src/raster/raster_converter.py:741-783`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch#24
No description provided.