Table of Contents
Shortcuts

# equalize

torchvision.transforms.functional.equalize(img: Tensor) → Tensor

  Equalize the histogram of an image by applying a non-linear mapping to the input in order to create a uniform distribution of grayscale values in the output.

  Parameters:

    img (PIL Image or Tensor) – Image on which equalize is applied. If img is torch Tensor, it is expected to be in […, 1 or 3, H, W] format, where … means it can have an arbitrary number of leading dimensions. The tensor dtype must be `torch.uint8` and values are expected to be in `[0, 255]`. If img is PIL Image, it is expected to be in mode “P”, “L” or “RGB”.

  Returns:

    An image that was equalized.

  Return type:

    PIL Image or Tensor

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.