This project has moved and is read-only. For the latest updates, please go here.

Is it possible to set "-evaluate Divide 2"

Feb 2, 2014 at 10:44 PM
I have some problems with images that have a transparent background.

The code
background.QuantumOperator(Channels.Alpha, EvaluateOperator.Set, Quantum.Max / 2);
returns weird results where the transparency of the background is lost. I did some tests with imagemagick via console and got the same wierd results. But when I use

convert my_image.png -alpha set -channel A -evaluate Divide 2 result.png

all alpha is set correct.

Is it possible to execute this command?
Feb 2, 2014 at 11:03 PM
Edited Feb 2, 2014 at 11:06 PM
Okay, it was too easy
background.QuantumOperator(Channels.Alpha, EvaluateOperator.Devide, 2);
Note: Seems to be a typo, it's "Divide", you called it "Devide"
Feb 2, 2014 at 11:06 PM
Edited Feb 2, 2014 at 11:06 PM
It seems I made a tiepo when I created the EvaluateOperator enum. This will be fixed in the next release of Magick.NET. I will also rename QuantumOperator to Evaluate.

You can however use the following command for now:
using (MagickImage image = new MagickImage("bpine_test.png"))
  image.QuantumOperator(Channels.Alpha, EvaluateOperator.Devide, 2);
Feb 2, 2014 at 11:11 PM
Thanks for your help!