Method: Magick::Image#sample

Defined in:
ext/RMagick/rmimage.cpp

#sample(scale) ⇒ Magick::Image #sample(cols, rows) ⇒ Magick::Image

Scale an image to the desired dimensions with pixel sampling. Unlike other scaling methods, this method does not introduce any additional color into the scaled image.

Overloads:

  • #sample(scale) ⇒ Magick::Image

    Parameters:

    • scale (Numeric)

      You can use this argument instead of specifying the desired width and height. The percentage size change. For example, 1.25 makes the new image 125% of the size of the receiver. The scale factor 0.5 makes the new image 50% of the size of the receiver.

  • #sample(cols, rows) ⇒ Magick::Image

    Parameters:

    • cols (Numeric)

      The desired width.

    • rows (Numeric)

      The desired height.

Returns:

See Also:



12407
12408
12409
12410
12411
12412
# File 'ext/RMagick/rmimage.cpp', line 12407

VALUE
Image_sample(int argc, VALUE *argv, VALUE self)
{
    rm_check_destroyed(self);
    return scale(False, argc, argv, self, GVL_FUNC(SampleImage));
}