Questions tagged [imagesharp]

A cross-platform library for the processing of image files; written in C#

ImageSharp is a new, fully featured, fully managed, cross-platform, 2D graphics API.

Designed to democratize image processing, ImageSharp brings you an incredibly powerful yet beautifully simple API.

Compared to System.Drawing we have been able to develop something much more flexible, easier to code against, and much, much less prone to memory leaks. Gone are system-wide process-locks; ImageSharp images are thread-safe and fully supported in web environments.

Built against .Net Standard 1.1 ImageSharp can be used in device, cloud, and embedded/IoT scenarios.

Documentation and Code Respository

https://sixlabors.github.io/docs/

https://github.com/SixLabors/ImageSharp

164 questions
2
votes
1 answer

Saving a transparent image to Gif, using ImageSharp, makes it opaque (white background)

I am using ImageSharp to save a half transparent image into GIF, but gif is saved with white background, no transparency. var gifEnc = new SixLabors.ImageSharp.Formats.Gif.GifEncoder(); edited.Save(cache, gifEnc); Gif Output, white background,…
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210
2
votes
2 answers

Getting ''Missing SOI marker.' from JpegDecoderr

I'm running into issues opening a jpg file. Here is the code I started with: var image = await Image.LoadAsync("sample.jpg") This produced the exception: An exception of type 'SixLabors.ImageSharp.UnknownImageFormatException' occurred in…
RQDQ
  • 15,461
  • 2
  • 32
  • 59
2
votes
1 answer

Imagesharp.Web Custom URL Pattern

I'm trying to map existing URL pattern to imagesharp.web to resize images. I found a method to do that using URL rewrites. Other than that, Is there any standard way to map an existing URL pattern to an imagesharp.web URL pattern? Existing URL…
2
votes
1 answer

ImageSharp.Web with AzureBlobStorageImageProvider giving 404's

Following the example code I'm attempting to hook up an ImageSharp.Web's AzureBlobStorageImageProvider but all image requests result in 404's. Any idea what I'm missing from my wiring-up? Looking at the docs it seems the url convention should be…
Gavin
  • 5,629
  • 7
  • 44
  • 86
2
votes
4 answers

Why am I getting Synchronous reads are not supported in ImageSharp?

I'm trying to use a Blazor input file, and also the Imagesharp library, to turn an IBrowserFile into an image. My method looks like this public async Task ConvertFileToByteArrayAsync(IBrowserFile file) { using var image…
sbrevolution5
  • 183
  • 2
  • 11
2
votes
0 answers

SixLabors.ImageSharp Compressing image is making the image bigger as a byte

I have compress method which is uses SixLabors.ImageSharp. When i compress a image on that method, its getting more size before then i upload it. The image i upload is 2,03 mb and when its come out from the compression method, its getting like that…
2
votes
3 answers

How load an image from disk and save to a stream using ImageSharp while preserving the mimetype

I've got a bunch of images stored on disk, with the mimetype of the image stored in a database. If I want to save the image to disk I can use Image.Save(string) (or the Async version) without needing to know the MimeType of the image. However, if I…
Moose Morals
  • 1,628
  • 25
  • 32
2
votes
2 answers

Cropping and moving pictures with SixLabors.ImageSharp in C#

I am using the SixLabors.ImageSharp to programatically crop an image in C# .NET Core 3.1. Below you can find a working code snippet. public static void ResizeImage(Image input, Size dimensions) { var options = new ResizeOptions { …
ccoutinho
  • 3,308
  • 5
  • 39
  • 47
2
votes
1 answer

Apply GaussianBlur or Pixelate to Polygon

i was able to apply GaussianBlur or Pixelate on rectangle areas. image.Mutate(x => x.GaussianBlur(5, new CoreRectangle(o.BoundingBox.X - 10, o.BoundingBox.Y - 10, o.BoundingBox.Width + 20, o.BoundingBox.Height + 20))); Is there a way to use a…
2
votes
1 answer

What's the most efficient way to generate multiple images from the same source? C# / Asp.Net

I'm creating an application that accepts large images from an IP Camera to be displayed on a website. Currently the images are 4K resolution with a size range from anywhere between 1MB to 3MB. These images are to be displayed into a gallery. For…
2
votes
0 answers

How to add image watermark using SixLabors Imagesharp package in .NET core

The code being used to create image using SixLabors.ImageSharp(1.0.0-beta0006) nuget is as below using (var image = Image.Load(filePath, out var imageFormat)) { image.Mutate(imageProcess => imageProcess.Resize(new ResizeOptions { …
2
votes
0 answers

Creating thumbnails with ImageSharp - performance improvements?

I'm using ImageSharp to convert some JPEG files from 4000x4000 (or so) images down to a set of different sized thumbnails (100x100, 250x250, 500x500 etc). The code below works pretty well, but wondering about any performance improvements - resizing…
Webreaper
  • 509
  • 4
  • 18
2
votes
1 answer

Saving two colour indexed (1bpp) PNG with Image Sharp

I'm using Image Sharp in an ASP.Net Core project and now need to prepare PNG images for a device that can only handle 2 colour indexed PNG images. If I use the following code, then the images are saved as palleted 2 colour images, but the result is…
2
votes
1 answer

Load and Save opaque 8 bit PNG Files using ImageSharp

I am trying to Load -> Manipulate byte array directly -> Save an 8 bit png image. I would like to use ImageSharp to compare its speeds to my current library, however in their code example they require the pixel type to be defined (they use…
Red Riding Hood
  • 1,932
  • 1
  • 17
  • 36
2
votes
2 answers

F# call .Net Function with generic params - wont compile

F# Beginner here, I want to draw a Polygon using ImageSharp. The build fails with: No overloads match for method 'DrawPolygon'. The available overloads are shown below. error FS0001: This expression was expected to have type 'Image' but here has…
JaggerJo
  • 734
  • 4
  • 15
1 2
3
10 11