skillfed

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.

gradio-imageslider v0.0.20 101.1K downloads/30d#12,964 on PyPI43
Permissive license DORMANT released

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-imageslider

uv

uv add gradio-imageslider

poetry

poetry add gradio-imageslider

Installing 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

Development Status :: 3 - AlphaLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Visualization

Tags

image comparison slidergradio image componentbefore after image viewerside-by-side image comparisongradio custom componentimage diff visualizationinteractive image slider
gradio-componentimage-processingui-widget

More Scientific/Engineering packages