powered by
Unless the width and height are carefully chosen, this operation will distort the image to force it to fit the dimensions
fill_area_with_img_expand( img, width, height, gravity = "Center", filter = "lanczos" )
magick image
target dimensions for final image
how to anchor the image during the operation. See magick::gravity_types()
magick::gravity_types()
default: lanczos
magick image of the required dimensions
# NOT RUN { filename <- system.file("img", "Rlogo.png", package="png") img <- magick::image_read(filename) fill_area_with_img_expand(img, 100, 400) # }
Run the code above in your browser using DataLab