logo <- image_read("logo:")
logo <- image_scale(logo, "400")
image_trim(logo)
image_chop(logo, "100x20")
image_rotate(logo, 45)
# Small image
rose <- image_convert(image_read("rose:"), "png")
# Resize to 400 width or height:
image_resize(rose, "400x")
image_resize(rose, "x400")
# Resize keeping ratio
image_resize(rose, "400x400")
# Resize, force size losing ratio
image_resize(rose, "400x400!")
# Different filters
image_resize(rose, "400x", filter = "Triangle")
image_resize(rose, "400x", filter = "Point")
# simple pixel resize
image_scale(rose, "400x")
image_sample(rose, "400x")
image_crop(logo, "400x400+200+200")
image_extent(rose, '200x200', color = 'pink')
image_flip(logo)
image_flop(logo)
skewed <- image_rotate(logo, 5)
deskewed <- image_deskew(skewed)
attr(deskewed, 'angle')
if(magick_config()$version > "6.8.6")
image_orient(logo)
image_shear(logo, "10x10")
building <- demo_image('building.jpg')
image_distort(building, 'perspective', c(7,40,4,30,4,124,4,123,85,122,100,123,85,2,100,30))
Run the code above in your browser using DataLab