Conor Neilson
Conor Neilson

Reputation: 1091

Programmatically determine whether magick image has effects applied

Say you have an image file in R defined with magick::image_read()

library(magick)
frink <- image_read("https://jeroen.github.io/images/frink.png")

You can then apply an effect to negate the image colors

frink_neg <- image_negate(frink)

What I'd like to know is whether there is any attribute in the frink_neg object that says that this is an image that has had the negation effect applied to it. Something like

class(frink_neg) == 'image-negate'

I tried running

image_info(frink_neg)
image_attributes(frink_neg)
image_data(frink_neg)

str(frink_neg)

But none of these seem to give any info about applied effects. Is there any way I can query for this? Ideally the solution would also work for any of the other filters supplied by magick (blur, charcoal, etc)

Upvotes: 2

Views: 49

Answers (0)

Related Questions