-
-
Save MbarkT3STO/c86876da03426e16d3cdc3ee8d218556 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static async Task<byte[]> BlurImage(string imagePath) | |
{ | |
return await Task.Run(() => | |
{ | |
var image = Image.Load(imagePath); | |
image.Mutate(ctx => ctx.GaussianBlur()); | |
using (var memoryStream = new MemoryStream()) | |
{ | |
image.SaveAsJpeg(memoryStream); | |
return memoryStream.ToArray(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment