Method: Magick::Image#crop

Defined in:
ext/RMagick/rmimage.cpp

#crop(x, y, width, height, reset = false) ⇒ Magick::Image #crop(gravity, width, height, reset = false) ⇒ Magick::Image #crop(gravity, x, y, width, height, reset = false) ⇒ Magick::Image

Extract a region of the image defined by width, height, x, y.

Overloads:

  • #crop(x, y, width, height, reset = false) ⇒ Magick::Image

    Parameters:

    • x (Numeric)

      x position of start of region

    • y (Numeric)

      y position of start of region

    • width (Numeric)

      width of region

    • height (Numeric)

      height of region

    • reset (Boolean) (defaults to: false)

      true if reset the cropped image page canvas and position

  • #crop(gravity, width, height, reset = false) ⇒ Magick::Image

    Parameters:

    • gravity (Magick::GravityType)

      the gravity type

    • width (Numeric)

      width of region

    • height (Numeric)

      height of region

    • reset (Boolean) (defaults to: false)

      true if reset the cropped image page canvas and position

  • #crop(gravity, x, y, width, height, reset = false) ⇒ Magick::Image

    Parameters:

    • gravity (Magick::GravityType)

      the gravity type

    • x (Numeric)

      x position of start of region

    • y (Numeric)

      y position of start of region

    • width (Numeric)

      width of region

    • height (Numeric)

      height of region

    • reset (Boolean) (defaults to: false)

      true if reset the cropped image page canvas and position

Returns:

See Also:



5040
5041
5042
5043
5044
5045
# File 'ext/RMagick/rmimage.cpp', line 5040

VALUE
Image_crop(int argc, VALUE *argv, VALUE self)
{
    rm_check_destroyed(self);
    return cropper(False, argc, argv, self);
}