Imagine I have an image called img.jpeg and I want to make half of it transparent.
I tried, without success, the code below:
library(jpeg)
img <- readJPEG("img.jpeg")
img[1:100, ] <- NA # all the NA pixels should be transparent
writeJPEG(img, "img_1.jpeg", bg = "transparent")
Any solution?