or run

tessl search
Log in

Version

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

tessl/pypi-imutils

tessl install tessl/pypi-imutils@0.5.0

A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeletonization, displaying Matplotlib images, sorting contours, detecting edges, and much more easier with OpenCV and both Python 2.7 and Python 3.

Agent Success

Agent success rate when using this tile

91%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.34x

Baseline

Agent success rate without this tile

68%

task.mdevals/scenario-3/

Image Rotation Tool

Build a command-line tool that rotates images by specified angles and saves the rotated results.

Capabilities

Basic rotation

  • It rotates an image 90 degrees clockwise and saves the result @test
  • It rotates an image 180 degrees and saves the result @test
  • It rotates an image 45 degrees and saves the result @test

Center point specification

  • It rotates an image around a custom center point when provided @test

Scaling during rotation

  • It applies a scaling factor while rotating an image @test

Implementation

@generates

The tool should:

  1. Accept an input image file path
  2. Accept a rotation angle in degrees
  3. Optionally accept a center point (x, y coordinates) for rotation
  4. Optionally accept a scale factor
  5. Save the rotated image to an output file path

The function should handle rotation around the image center by default, and allow custom rotation centers when specified.

API

def rotate_image(input_path: str, output_path: str, angle: float, center: tuple = None, scale: float = 1.0) -> None:
    """
    Rotates an image by the specified angle and saves it.

    Args:
        input_path: Path to the input image file
        output_path: Path to save the rotated image
        angle: Rotation angle in degrees (positive = clockwise)
        center: Optional (x, y) tuple for rotation center point
        scale: Optional scaling factor to apply during rotation
    """
    pass

Dependencies { .dependencies }

imutils { .dependency }

Provides convenient image processing utilities for OpenCV.