module

StumpyResize

Constants

DEFAULT_INTERPOLATION_METHOD = InterpolationMethod::Lanczos
VERSION = "1.3.1"

Class methods

blur(image : Canvas, radius : Int32) : Canvas
Source
crop(canvas : Canvas, start_x : Int32, start_y : Int32, end_x : Int32, end_y : Int32) : Canvas

Crop function

Source
lanczos_a

adjust this up to improve quality

Source
lanczos_a=(lanczos_a : Int32)

adjust this up to improve quality

Source
resize(image : Canvas, new_width : Int32, new_height : Int32, method : InterpolationMethod = DEFAULT_INTERPOLATION_METHOD) : Canvas
Source
resize_bicubic(image : Canvas, new_image : Canvas) : Nil

Cubic Convolution Algorithm

Source
resize_bilinear(image : Canvas, new_image : Canvas) : Nil
Source
resize_lanczos(image : Canvas, new_image : Canvas) : Nil
Source
resize_nearest_neighbor(image : Canvas, new_image : Canvas) : Nil
Source
scale_to_cover(canvas : Canvas, desired_width : Int32, desired_height : Int32, resize_method : InterpolationMethod = DEFAULT_INTERPOLATION_METHOD) : Canvas

scales the original image so that it covers the desired dimensions while maintaining the original aspect ratio. Then it copies the center part of the resized image onto the new canvas, effectively cropping the image.

Source
scale_to_fit(canvas : Canvas, desired_width : Int32, desired_height : Int32, resize_method : InterpolationMethod = DEFAULT_INTERPOLATION_METHOD) : Canvas

scales the image to fit the desired view port, adding letterboxing or pillarboxing as required

Source

Nested types