CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-pycuda

Python wrapper for Nvidia CUDA parallel computation API with object cleanup, automatic error checking, and convenient abstractions.

62%

Overall

Evaluation62%

0.94x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-9/

Image Brightness Adjustment

A GPU-accelerated image processing module that adjusts brightness of grayscale images.

Capabilities

Brightens images with positive adjustment

The module should increase the brightness of a grayscale image by adding a positive value to each pixel, clamping results to the valid range [0, 255].

  • Given a 512x512 grayscale image (uint8) with uniform value 100, applying a brightness adjustment of +50 results in all pixels having value 150 @test
  • Given a 512x512 grayscale image with uniform value 220, applying a brightness adjustment of +50 results in all pixels clamped to 255 @test

Darkens images with negative adjustment

The module should decrease the brightness of a grayscale image by adding a negative value to each pixel, clamping results to the valid range [0, 255].

  • Given a 512x512 grayscale image with uniform value 100, applying a brightness adjustment of -50 results in all pixels having value 50 @test
  • Given a 512x512 grayscale image with uniform value 30, applying a brightness adjustment of -50 results in all pixels clamped to 0 @test

Processes different image sizes

The module should handle various image dimensions correctly.

  • Given a 1024x768 grayscale image with uniform value 128, applying a brightness adjustment of +20 results in all pixels having value 148 @test

Preserves image with zero adjustment

The module should return an unchanged image when the adjustment value is zero.

  • Given a 512x512 grayscale image with random values, applying a brightness adjustment of 0 results in the exact same image @test

Implementation

@generates

API

import numpy as np

def adjust_brightness(image: np.ndarray, adjustment: int) -> np.ndarray:
    """
    Adjusts the brightness of a grayscale image using GPU acceleration.

    Args:
        image: A 2D NumPy array of uint8 values representing a grayscale image
        adjustment: An integer value to add to each pixel (can be positive or negative)

    Returns:
        A new 2D NumPy array of uint8 values with adjusted brightness,
        with all values clamped to the range [0, 255]
    """
    pass

Dependencies { .dependencies }

pycuda { .dependency }

Provides GPU computing capabilities for parallel image processing.

tessl i tessl/pypi-pycuda@2025.1.0

tile.json