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

Photoshop high pass filter

Jun 8, 2016 at 7:16 PM

I try to rebuild a Photoshop high pass filter using ImageMagick convolve.

From the ImageMagick documentation, I got the following:
convert face.png -bias 50% -morphology Convolve DoG:0,0,2 face_dog_unity.png

I tried the following in
image.Morphology(MorphologyMethod.Convolve, Kernel.DoG, "0,0,2");

What is missing is the -bias. How can I achieve the filter?

Thanks for your help
Jun 9, 2016 at 6:40 AM
Edited Jun 9, 2016 at 6:41 AM
You will need to set the artifact 'convolve:bias'. That is what is being done on the command line.
image.SetArtifact("convolve:bias", "50%");
I should probably also make this available in code a bit easier. I think that adding a new MorphologySettings class for this would be the next wise step instead of adding two new argument to the method (there is also an option called 'convolve:scale').
Jun 10, 2016 at 9:35 AM
Edited Jun 10, 2016 at 9:35 AM
The new class has been added and will be available in the next release:
Jul 26, 2016 at 5:44 AM
After updating to your latest version, I tried both,
image.SetArtifact("convolve:bias", "50%");
and the new MorphologySettings
var settings = new MorphologySettings();
settings.Kernel = Kernel.DoG;
settings.KernelArguments = "0,0,2";
settings.ConvolveBias = new Percentage(50);
Unfortunately, for both examples, I only get a white image as a result which differs from the command line call.

Do you have any idea?

Thanks again
Jul 26, 2016 at 8:50 PM
Can you share your input image so I can try to reproduce your issue? Please use something like DropBox or OneDrive to share it.
Jul 26, 2016 at 9:17 PM

I tried several input images, including this one:
All images result in a white output image.

Kind regards
Jul 29, 2016 at 9:46 AM
You will also need to set the method in the settings class. I did not include that in my example:
settings.Method = MorphologyMethod.Convolve;