Ctrl + K
DocumentationLog inGet started

tessl/pypi-rembg

tessl install tessl/pypi-rembg@2.0.0

Remove image background using advanced AI models including U-Net, BiRefNet, and SAM with support for multiple input formats and GPU acceleration

Agent Success

Agent success rate when using this tile

84%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.94x

Baseline

Agent success rate without this tile

89%

task.mdevals/scenario-7/

Image Orientation Corrector

A utility that processes images with different orientations and prepares them for further processing by removing backgrounds while preserving correct orientation.

Problem Statement

Images from digital cameras and smartphones often contain EXIF metadata that specifies how the image should be rotated for proper display. When processing such images (e.g., for background removal), it's crucial to handle this orientation data correctly to ensure the output appears as expected.

Your task is to create a tool that processes images with various EXIF orientations, removes their backgrounds, and outputs correctly oriented results.

Requirements

Core Functionality

The tool must:

  1. Accept an input image file path and an output file path
  2. Read the input image (which may have EXIF orientation metadata)
  3. Remove the background from the image
  4. Save the result to the output path with correct orientation

Test Cases

  • Given an image rotated 90 degrees clockwise (EXIF orientation 6), the background is removed and the output image maintains correct orientation @test
  • Given an image rotated 180 degrees (EXIF orientation 3), the background is removed and the output image maintains correct orientation @test
  • Given an image with no EXIF orientation data, the background is removed without errors @test

Implementation

@generates

API

def process_image(input_path: str, output_path: str) -> None:
    """
    Process an image by removing its background while preserving orientation.

    Args:
        input_path: Path to the input image file
        output_path: Path where the processed image should be saved

    Raises:
        FileNotFoundError: If input_path does not exist
        ValueError: If the input file is not a valid image
    """
    pass

Dependencies { .dependencies }

rembg { .dependency }

Provides background removal functionality with automatic EXIF orientation handling.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/rembg@2.0.x
tile.json