
Install the SixLabors.ImageSharp package
Load the image
using MemoryStream memStream = new (imgBytes);
using Image image = Image.Load(memStream);
Do the resize action
image.Mutate(x => x.Resize(400, 400));
Save the result
using MemoryStream outStream = new ();
image.Save(outStream);
Tags
.NET