Hi, c#
Your code from http://www.imagemagick.org/Usage/photos/#tilt_shift
how to translate to c#?
convert beijing_md.jpg -sigmoidal-contrast 15x30% \
\( +clone -sparse-color Barycentric '0,0 black 0,%h gray80' \
-solarize 50% -level 50%,0 \) \
-compose Blur -set option:compose:args 10 -composite \
beijing_model.jpg
but I cant create all
1]
var sharpen = 15;
tilt.SigmoidalContrast(true, Math.Abs(sharpen), 30);
List<SparseColorArg> args = new List<SparseColorArg>();
args.Add(new SparseColorArg(0, 0, new MagickColor("white")));
args.Add(new SparseColorArg(0, image.Height/4, new MagickColor("black")));
tilt.SparseColor(SparseColorMethod.Barycentric, args);
this gives me half of background image -> blurmap http://www.imagemagick.org/Usage/photos ... map_tn.gif
2]
how to translate
-set option:compose:args 10
best regards
ala
Tilt image in c#
-
- Posts: 21
- Joined: 2016-10-03T05:11:21-07:00
- Authentication code: 1151
Re: Tilt image in c#
Below is a translation of your command line:
Code: Select all
// convert beijing_md.jpg
using (MagickImage image = new MagickImage("beijing_md.jpg"))
{
// -sigmoidal-contrast 15x30%
// This overload will be available in the next version, you will need to use Quantum.Max * 0.3 for now.
image.SigmoidalContrast(15, new Percentage(30));
using (MagickImage clone = image.Clone()) // +clone
{
var black = new SparseColorArg(0, 0, new MagickColor("black"));
var gray80 = new SparseColorArg(0, clone.Height, new MagickColor("gray80"));
// -sparse-color Barycentric '0,0 black 0,%h gray80'
// This overload will be available in the next version, you will need to use a list for now.
clone.SparseColor(SparseColorMethod.Barycentric, black, gray80);
clone.Solarize(new Percentage(50)); // -solarize 50%
clone.Level(new Percentage(50), new Percentage(0)); // -level 50%,0
// -compose Blur -set option:compose:args 10 -composite
image.Composite(clone, CompositeOperator.Blur, "10");
// beijing_model.jpg
image.Write("beijing_model.jpg");
}
}
-
- Posts: 21
- Joined: 2016-10-03T05:11:21-07:00
- Authentication code: 1151
Re: Tilt image in c#
Thanks a lot
Working I just tilt'ed some images
@dlemstra Thank You!
Working I just tilt'ed some images
@dlemstra Thank You!