There is a sandbox limit about System.Drawing, in my experience I used the Magick.NET
to solve this problem. You could refer to my previous answer.
In that test I just put gsdll32.dll
in the wwwroot folder then it will work, however this time I got a problem it always prompts could not load Magick.NET-Q16-x86.Native.dll file then I upload the Magick.NET-Q16-x86.Native.dll file from the runtime\native folder and this will solve the problem.
Below is my test code.
[FunctionName("Function1")]
public static void Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,ExecutionContext context,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
MagickNET.SetGhostscriptDirectory(context.FunctionAppDirectory);
using (var img = new MagickImage(context.FunctionAppDirectory + "\\test.jpg"))
{
img.Write(context.FunctionAppDirectory + "\\test.png");
}
}
Here is the result and the bin folder.

