library(magick)
## Warning: package 'magick' was built under R version 4.2.3
## Linking to ImageMagick 6.9.12.3
## Enabled features: cairo, freetype, fftw, ghostscript, heic, lcms, pango, raw, rsvg, webp
## Disabled features: fontconfig, x11
image_inp <- image_read("https://assets.hops.id/crop/0x0:0x0/750x500/webp/photo/2023/06/13/6-Fakta-menarik-Gabriel-Guevara-485455120.jpg")
plot(image_inp)

image_info(image_inp)
##   format width height colorspace matte filesize density
## 1   WEBP   750    500       sRGB FALSE    14498   72x72
image_charcoal(image_inp,radius = 2,sigma = 1)

model_img <- image_modulate(image_inp,brightness = 150,saturation = 130)
plot(model_img)

image_background(image_inp,color = "black",flatten = TRUE)

plot(image_background(image_inp,color = "black",flatten = TRUE))

image_noise(image_inp)

plot(image_noise(image_inp))

image_blur(image_inp)

plot(image_blur(image_inp))

gambar <- image_blank(width = 500,height = 300,color = "black",pseudo_image = "",defines = NULL)
plot(gambar)

gambar_dengan_teks <- image_annotate(gambar, "Putri Nabilla", size = 40, color = "white", location = "+10+10")
plot(gambar_dengan_teks)

Anda dapat menyesuaikan ukuran, lokasi, jenis huruf, warna, dan properti lainnya dalam fungsi image_annotate() sesuai kebutuhan Anda. Selain itu, Anda juga dapat menambahkan elemen visual lainnya ke gambar menggunakan fungsi-fungsi lain dari paket magick.

Harap diingat bahwa untuk menggunakan magick, Anda juga perlu menginstal perangkat lunak ImageMagick di sistem Anda dan memastikan bahwa ImageMagick telah dikonfigurasi dengan benar di lingkungan RStudio.