Class Pad

java.lang.Object
io.github.palexdev.imcache.transforms.Pad
All Implemented Interfaces:
Transform

public class Pad extends Object implements Transform

The Pad class implements a padding transformation for images.

It resizes an input image to fit within the target dimensions while preserving the aspect ratio and centers it on a new canvas filled with a specified padding color. This ensures that the final image has the exact target dimensions without cropping or stretching the original content.

  • Constructor Details

    • Pad

      public Pad(double targetWidth, double targetHeight)
    • Pad

      public Pad(double targetWidth, double targetHeight, Color paddingColor)
  • Method Details