gradio-imageslider
A Gradio component for comparing two images. This component can be used in several ways: - as a **unified input / output** where users will upload a single image and an inference function will generate an image it can be compared to (see demo), - as a **manual upload input** allowing users to compare two of their own images (which can then be passed along elsewhere, e.g. to a model), - as **static output component** allowing users to compare two images generated by an inference function.
What it is and what it does
ImageSlider is a custom Gradio component that embeds an interactive slider overlay for comparing two images. It accepts images as PIL objects, numpy arrays, file paths, or URLs, and lets users drag a slider to reveal one image or the other. The component works in three modes: as a unified input/output (user uploads one image, a function generates a comparison), as a manual dual-upload input (users compare their own images), or as a static output display (a function generates both images for comparison).
The slider position, dimensions, and styling are configurable, and the component integrates with Gradio's event system (upload, change events). It depends only on gradio and pillow, making it lightweight to add to existing Gradio applications. The package is in Alpha status and has not been updated since 2024-04-19, so it is suitable for stable, non-evolving use but may not track breaking changes in newer Gradio releases.
Use it for:
- Compare before/after images in image processing or ML inference demos (e.g., denoising, super-resolution, style transfer).
- Allow users to manually upload and compare two of their own images for visual analysis or quality assessment.
- Display side-by-side model outputs in a Gradio app to help users evaluate inference results visually.
- Build interactive documentation or tutorials showing the effect of image filters or transformations.
- Create A/B testing interfaces where users can compare two generated or edited versions of an image.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Gradio component that displays two images side-by-side with an interactive slider for comparing them, supporting image upload, generation, or static display.
Yes, if you are building a Gradio app that needs image comparison and can tolerate a dormant package. The component is lightweight, has no known vulnerabilities, and uses permissive licensing. However, verify compatibility with your Gradio version before deploying, since the package has not been updated since 2024-04-19 and may lag behind Gradio's evolution.
Install
gradio-imageslider on PyPI
pip
pip install gradio-imageslideruv
uv add gradio-imagesliderpoetry
poetry add gradio-imagesliderInstalling gradio-imageslider
Before you install
Low install friction with a pure Python wheel. The package is dormant (last commit 2024-05-20), but carries only two lightweight runtime dependencies: gradio and pillow. Suitable for stable, maintenance-light use cases.
License in practice
Licensed under Apache Software License (permissive), allowing commercial and private use without restriction.
Quickstart
pip install gradio-imageslider
import gradio as gr
from gradio_imageslider import ImageSlider
def fn(im):
if not im or not im[0]:
return im
return (im[0], im[0])
with gr.Blocks() as demo:
img1 = ImageSlider(label="Compare images", type="pil", slider_color="pink")
img1.upload(fn, inputs=img1, outputs=img1)
demo.launch()
Requires Python >=3.9 and an active Gradio application context (gr.Blocks or gr.Interface).
Verify before relying
- Whether the component works reliably with current Gradio versions (last package release was 2024-04-19).
- Performance characteristics when handling large or high-resolution images.
- Accessibility features for keyboard navigation or screen readers on the slider control.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — gradio, pillow |
| Maintenance | dormant — 847 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 101,093/month — #12,964 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gradio_imageslider-0.0.20-py3-none-any.whl
Keywords: gradio, gradio custom component, machine learning, reproducibility, visualization
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
gradio-pdfProvides a PDF display component for Gradio…
permissive · top 15,000 on PyPI
gradio-rangesliderA Gradio custom component that adds a…
unclear · top 15,000 on PyPI
gradioGradio builds web interfaces for machine…
permissive · top 5,000 on PyPI
hf-gradioA CLI tool for discovering endpoints and…
permissive · top 5,000 on PyPI
streamlit-vertical-sliderAdds a vertical slider widget to Streamlit apps…
unclear · top 15,000 on PyPI
pixelmatchCompares two images pixel-by-pixel to detect…
permissive · top 5,000 on PyPI
streamlit-pdf-viewerStreamlit component that renders PDF documents…
unclear · top 15,000 on PyPI
gradio-clientCalls any Gradio app as a Python API with a…
permissive · top 5,000 on PyPI
streamlit-image-coordinatesA Streamlit component that displays an image…
permissive · top 15,000 on PyPI
icdiffIcdiff displays file differences in a…
permissive · top 5,000 on PyPI