Is it possible to set "-evaluate Divide 2"

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

The code
background.Alpha(AlphaOption.Set);
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 10:03 PM
Edited Feb 2, 2014 at 10:06 PM
Okay, it was too easy
background.Alpha(AlphaOption.Set);
background.QuantumOperator(Channels.Alpha, EvaluateOperator.Devide, 2);
Note: Seems to be a typo, it's "Divide", you called it "Devide"
Coordinator
Feb 2, 2014 at 10:06 PM
Edited Feb 2, 2014 at 10: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.Alpha(AlphaOption.Set);
  image.QuantumOperator(Channels.Alpha, EvaluateOperator.Devide, 2);
  image.Write("bpine_out.png");
}
Feb 2, 2014 at 10:11 PM
Thanks for your help!