This project has moved. For the latest updates, please go here.

Transform Image

Apr 8, 2016 at 5:08 AM
I am trying to cartoonify the image. The nearest match I found are these SO answer:
  1. http://stackoverflow.com/questions/1357403/how-to-cartoon-ify-an-image-programmatically
  2. http://stackoverflow.com/questions/4062365/turning-photo-into-cartoon-using-php
  3. http://stackoverflow.com/questions/4058224/creation-of-edge-detection-based-image-in-php
  4. http://www.imagemagick.org/Usage/photos/#charcoal
I tried doing this as follows:
string FilePath = "../path/1.jpg";
MagickReadSettings settings = new MagickReadSettings();
settings.SetDefine(MagickFormat.Jpeg, "charcoal", "5");
using (MagickImage image = new MagickImage(FilePath))
  {
    image.Resize(100,0);
    image.Write(FilePath);
   }
But it did not work. It only resized the image. It did not apply any filters.

Could you tell me how I can cartoonify images in Magick.net? Thanks you :)
Coordinator
Apr 15, 2016 at 10:51 AM
You are not using the settings but even if you used it it would not work. Your call to SetDefine does nothing. You will need to call the Charcoal method instead:
string FilePath = "../path/1.jpg";
using (MagickImage image = new MagickImage(FilePath))
  {
    image.Resize(100,0);
    image.Charcoal(5, 1);
    image.Write(FilePath);
   }
And you could also give Sketch (that method is pretty slow though).