Method: Magick::Image#reduce_noise

Defined in:
ext/RMagick/rmimage.cpp

#reduce_noise(radius) ⇒ Magick::Image

Smooth the contours of an image while still preserving edge information.

Parameters:

  • radius (Numeric)

    A neighbor is defined by radius. Use a radius of 0 and reduce_noise selects a suitable radius for you.

Returns:



11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
# File 'ext/RMagick/rmimage.cpp', line 11796

VALUE
Image_reduce_noise(VALUE self, VALUE radius)
{
    Image *image, *new_image;
    ExceptionInfo *exception;
    size_t radius_size = NUM2SIZET(radius);

    image = rm_check_destroyed(self);

    exception = AcquireExceptionInfo();
    GVL_STRUCT_TYPE(StatisticImage) args = { image, NonpeakStatistic, radius_size, radius_size, exception };
    new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(StatisticImage), &args);
    rm_check_exception(exception, new_image, DestroyOnError);

    DestroyExceptionInfo(exception);

    return rm_image_new(new_image);
}