--- title: Image Cleanup emoji: 🧑‍🔬 colorFrom: pink colorTo: yellow sdk: gradio sdk_version: 6.19.0 python_version: "3.10" app_file: app.py pinned: false --- # Image cleanup Script for removing dark, low-saturation debris from IHC images with OpenCV inpainting. ```bash uv sync uv run python main.py data/example.png ``` PNG, JPEG, TIFF, and TIF inputs are supported. Cleaned images are written to `out/cleaned/` with `_cleaned` added before the original extension, and masks are written to `out/masks/` as PNG files. An optional Gradio interface is also available: ```bash uv run python app.py ``` Open the local URL printed in the terminal, upload an input image, and select **Clean image**. TIFF inputs are converted to PNG previews in the interface, and the cleaned file can be downloaded with the original extension. For batch processing, open the **Image directory** tab and select a folder. The app processes all uploaded images, including `.tif` and `.tiff` files, and returns a ZIP archive. Project layout: - `main.py` — primary image-cleaning script - `cleaning.py` — reusable cleaning operations - `app.py` — optional Gradio interface - `data/` — source and example images - `out/` — generated cleaned images and masks - `test.ipynb` — image-cleaning experiments