--- id: gradio-imageslider version: "0.0.20" license: unclear license_treatment: permissive maintenance: dormant --- # 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. License: permissive · Maintenance: dormant · Downloads: 101.1K/mo ## 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 above — 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 pip install gradio-imageslider uv add gradio-imageslider 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_current - Install friction: low - Maintenance: dormant - Downloads: 101.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags image comparison slider, gradio image component, before after image viewer, side-by-side image comparison, gradio custom component, image diff visualization, interactive image slider, gradio-component, image-processing, ui-widget [View on SkillFed](https://skillfed.io/packages/gradio-imageslider) · [View on PyPI](https://pypi.org/project/gradio-imageslider/)