Rank: Newbie
Groups: Member
Joined: 2/7/2019(UTC) Posts: 9
Thanks: 6 times
|
Is it possible to perform the following operations using the "memory friendly" method? - read JPG
- read PNG
- crop JPG
- resize JPG
- sharpen JPG
- auto contrast JPG
- draw PNG on JPG << I don't know how to do that
- save new file
but I don't know how to overlay a PNG on my main bitmap i tried to do it like this: Code:
using (var reader = ImageReader.Create(fileInput))
using (var overlay = ImageReader.Create(fileOverlay))
using (var crop = new Crop())
using (var resize = new Resize(3000, 2000, ResizeInterpolationMode.Lanczos))
using (var sharpen = new Sharpen(V.sharpnessValue))
using (var contrast = new Contrast() { Auto = true })
using (var drawer = new Aurigma.GraphicsMill.AdvancedDrawing.Drawer())
using (var writer = ImageWriter.Create(fileOutput))
{
crop.OnInit += (sender, e) =>
{
var cropRectangle = MakeCropRectangle(sender, e);
(sender as Crop).Rectangle = Rectangle.Round(cropRectangle);
};
drawer.Draw += delegate (object sender, DrawEventArgs e)
{
e.Graphics.DrawImage( ??? );
};
var pipeline = new Pipeline();
pipeline.Add(reader);
if (V.isCrop) pipeline.Add(crop);
if (V.isSharpness) pipeline.Add(sharpen);
pipeline.Add(resize);
if (V.isAutoCorrect) pipeline.Add(contrast);
pipeline.Add(drawer);
pipeline.Add(writer);
pipeline.Run();
}
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
Hi, Please take a look at Combiner or Blender if you need to overlay images using blend modes. This way is more performant than using DrawImage from Drawer. |
Best regards, Eugene Kosmin The Aurigma Development Team
|
1 user thanked Eugene Kosmin for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.