ropensci / magick

Magic, madness, heaven, sin
https://docs.ropensci.org/magick
Other
462 stars 65 forks source link

Adjust opacity/transparency of image #316

Open moldach opened 3 years ago

moldach commented 3 years ago

I would like to overlay two images with image_mosaic() where one of the images is 50% transparent.

I was able to find a solution that works using the CLI but I'm not sure what the appropriate (if any) solution would be in magick r version?

For example, the following solution at this website works for me:

magick convert images/qrcode.png -alpha set -background none -channel A -evaluate multiply 0.420 +channel images/qrcode.png

I'm able to overlay a QR code on top a image that allows me to still scan that image.

dcaud commented 2 years ago

Something like this overlays with transparency:

wizard %>%
  image_composite(rose, operator = "dissolve",compose_args = "80%",
                  gravity="center")