There are different packages in r to edit the images. The most used one is Magick.
Basic syntax is image_function([image object], attributes)
Few functions in Magick for editing image are -
image_flip(img) - Invert the direction of image horizontally.
image_flop(img) - invert the image vertically.
image_annotate(img,position, text) - add text alomg with image
image_background/border(img, color/dimensions = [value])
image_scale(img, [scale]) - rezise the image
image_modulate(img, saturation = [value],hue = [value]) - change the saturation and color of whole image
image_crop(img, [positions])
image_fill(img, ) - edit the colors in the image by providing image positions.
image_blur/noice/charcoal/oilpaint(img) - edit the mode of image