Search code examples
imagemagickcompositepythonmagick

PythonMagic: How do a composite with a dissolve value?


I like to do this with PythonMagick:

composite -dissolve 40 over.png base.png new.png

I have tried:

import PythonMagick
base = PythonMagick.Image("base.png")
over = PythonMagick.Image("over.png")
base.composite(over,0,0,PythonMagick.CompositeOperator.DissolveCompositeOp)
base.write("some.png")

That works fine, but how can I specify the dissolve value?

Thanks in advance

Thomas


Solution

  • Based on your other question, I would recommend staying with PIL since PythonMagick seems to be inactive. I also looked into Magick++'s documentation, but it fails to mention how to specify extra options for composite. I would stay away from these libraries, and instead use the direct CLI provided by ImageMagick.