corner-radius Mask Corner Radius


  • mask=corners
  • w or h


  • Default: 20% of the smaller dimension.
  • Range: 0 to ½ of the smaller dimension.
  • Format:
    • MM: Integer; will apply the same radius value to all four corners
    • MM,NN,XX,YY: Comma-separated integers, each representing the value for one corner of the image, starting at the top left.

When mask=corners is set on an image to create rounded corners, corner-radius specifies the width of the rounding in pixels. The masked area defaults to transparent (PNG output only) or white.

The corners can also be controlled individually by using a set of four comma-separated values to define the radius of each corner, starting at the top left. This makes common use cases such as only rounding the top or bottom simple to implement.

If maskbg is also applied, the masked area will fill in with the specified color.