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

vignette effect

May 27, 2013 at 1:41 PM
Hello,

Sorry for the complete newbie question and most of all many thanks for this absolute great project!

I am trying to do something along the lines below and currently use convert.exe via a shell process called from the C# code:

( -size 960x960 radial-gradient:none-black -gravity center -crop 640x640+0+0 +repage ) -compose multiply -flatten

Is there any way to mirror such with Magick.NET?

Many thanks for the advice & all the best!
May 27, 2013 at 7:33 PM
At this moment it is not possible. With changeset 26420 I resolved this issue but you have to wait for the next release (prob. next week) before you can use it.

I am not sure if this gives you the same result but it should be something like this:
using (MagickImageCollection images = new MagickImageCollection())
{
  MagickReadSettings settings = new MagickReadSettings();
  settings.Width = 960;
  settings.Height = 960;
  
  MagickImage radialGradient = new MagickImage("radial-gradient:none-black", settings);
  radialGradient.Crop(640, 640, Gravity.Center);
  images.Add(radialGradient);
  
  MagickImage input = new MagickImage("input.jpg");
  input.Compose = CompositeOperator.Multiply;
  images.Add(input);
  
  images.RePage();
  
  using (MagickImage output = images.Merge(LayerMethod.Flatten))
  {
    output.Write("output.jpg");
  }
}
May 27, 2013 at 9:10 PM
Hi dlemstra,

Many thanks for the reply and looking forward to the next release!

This is really great!