Method: Magick::Image#trim

Defined in:
ext/RMagick/rmimage.cpp

#trim(reset = false) ⇒ Magick::Image

Removes the edges that are exactly the same color as the corner pixels. Use the fuzz attribute to make trim remove edges that are nearly the same color as the corner pixels.

Returns a new image.

Parameters:

  • reset (Boolean) (defaults to: false)

    The trim method retains the offset information in the cropped image. This may cause the image to appear to be surrounded by blank or black space when viewed with an external viewer. This only occurs when the image is saved in a format (such as GIF) that saves offset information. To reset the offset data, use true as the argument to trim.

Returns:

See Also:



14985
14986
14987
14988
14989
14990
# File 'ext/RMagick/rmimage.cpp', line 14985

VALUE
Image_trim(int argc, VALUE *argv, VALUE self)
{
    rm_check_destroyed(self);
    return trimmer(False, argc, argv, self);
}