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

Hard Mix question

May 9, 2015 at 11:54 AM
Edited May 9, 2015 at 11:55 AM
Is there a difference in the way Magick.NET (or ImageMagick) processes a HardMix composite in comparison to Photoshop?
If I take the following blue and red channels in photoshop and apply Hard Mix to the first layer (layers can be in either order) I get the following result:

Blue channel:

Red channel

Photoshop Hard Mix result

However, when I try the same in Magick.NET, the result is a completely black image:

My code is as follows:
            List<MagickImage> imgs = new List<MagickImage>();
            MagickImage img = new MagickImage(Path.Combine(testCollectionPath, Path.GetFileName(fileName)));

            int i = 0;
            foreach (MagickImage channel in img.Separate(Channels.RGB))

            MagickImage chRed = imgs[0];
            MagickImage chBlue = imgs[2];

            MagickImage chProc = chBlue.Clone();

            chProc.Composite(chRed, CompositeOperator.HardMix);

            return imgs;
I think the structure of the code is basically correct as I've managed to get other composite functions working with it.

Does anyone have any suggestions as to what might be occurring or how I might better emulate the Photoshop version of hard mix please?

Thanks in advance,

*Edit: Sorry, image code didn't seem to work with dropbox links
May 9, 2015 at 5:25 PM
It looks like there is something wrong with HardMix in ImageMagick 7. It does work in ImageMagick 6 but the result is different from what you created with Photoshop. I will look into this and get back when I know more.
May 10, 2015 at 1:00 AM
Thank you, I appreciate your time.
May 23, 2015 at 4:38 PM
I just committed a patch to the SVN repository of ImageMagick to fix this. This will be fixed in the next release of Magick.NET
May 26, 2015 at 11:25 AM
Great news, thanks Dirk.