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
1
vote
1 answer

Create image from palette indexes with ImageSharp

I have an array of bytes that represents the palette indexes of the pixels of an image, and I'm trying to convert this to an image with ImageSharp, so I can save it later as PNG, but I can't seem to find how, can anyone give me an idea on where to…
ivancmz
  • 33
  • 5
1
vote
1 answer

.NET Core API saving image upload asynchronously with ImageSharp, MemoryStream and FileStream

I have a .NET Core API that I'd like to extend to save uploaded images asynchronously. Using ImageSharp I should be able to check uploads and resize if predefined size limits are exceeded. However I can't get a simple async save working. A simple…
1
vote
1 answer

C# Six Labors ImageSharp runtime error System.Memory 4.0.1.0 Visual Studio 2019

In a project loaded in Visual Studio 2019 where image manipulation is needed, the Six Labors ImageSharp library is used. But when trying to load an image, the runtime error pops up: FileNotFoundException: Could not load file or assembly…
Postie
  • 324
  • 3
  • 15
1
vote
2 answers

Determining the contract color of an area of a photo

Trying to figure out a way to determine the best contrasting color for an areas of a photo. The contrasting color is to be used as the color of some overlaying text. Using Six Labor ImageSharp, far I've been able to: Loaded the image stream into…
1iveowl
  • 1,622
  • 1
  • 18
  • 31
1
vote
2 answers

How to add transparent padding to a jpg and save it as png with transparency?

The documentation for SixLabors ImageSharp is very limited, and most google searches leads to GitHub, which is not very helpful. How can I upload a jpg, .Mutate it with transparent padding and save it as a png with transparency? This is the code I…
Stian
  • 1,522
  • 2
  • 22
  • 52
1
vote
1 answer

How to add tiling / repeat watermark with ImageSharp?

I want add tiling/repeat watermark to image by using ImageSharp 1.0.0-beta7. I need figure out how many watermarks and how many points where watermark display. Then use DrawText function to draw one by one. Is there any extension or library to fill…
Calx
  • 31
  • 5
1
vote
1 answer

MemoryStream throws exception of type InvalidOperationException

I hope that you can help :) In my MVC.net core 2.2, when debugging a simple: MemoryStream ms = new MemoryStream(); Right after initialization it gives me a: ReadTimeout: 'ms.ReadTimeout' threw an exception of type…
Anda Hendriksen
  • 43
  • 1
  • 1
  • 5
1
vote
1 answer

ImageSharp - resize image from stream

I'm using SixLabors' ImageSharp with ImageSharp.Web in my Asp.net Core project. Image resizing works well with query strings for images that are stored on disk. Example: /myimage.jpg?width=10&height=10&rmode=max However, ImageSharp doesn't seem to…
Johnny Oshika
  • 54,741
  • 40
  • 181
  • 275
1
vote
1 answer

Uploading image file to AWS Lambda .Net Core application from browser results in unusable file - how to fix?

I was uploading a jpg image from my browser, as a part of a form, to my .Net Core web api which resides on AWS Lambda. It uploaded but resulted in errors when I tried to process it using ImageSharp. Also I noticed that the file size of the uploaded…
Reid
  • 3,170
  • 2
  • 23
  • 37
1
vote
0 answers

.NET Core ImageSharp image scaling

I have two images, one as background and one containing a signature. I want to be able to down/up scale the signature depending on a scalefactor but within the the height/width of the background. I've tried AffineTransformBuilder.AppendScale without…
Henrik
  • 1,797
  • 4
  • 22
  • 46
1
vote
0 answers

.net core stream file from Azure and resize

I am trying to take a file from an Azure blob, resize it using ImageSharp, and serve it to the client. I have the following code, which works: public async Task GetFile(string url, int width =0, int height=0) { // Connect…
Chris Kooken
  • 32,730
  • 15
  • 85
  • 123
1
vote
1 answer

Trying to return an image via MVC controller action after using ImageSharp resizing

I am trying to take an image, resize it with ImageSharp via image.Mutate, save it to a stream, and return the image as a file via mvc controller to an Angular client. This is my code I am using to alter the image: public static MemoryStream…
Jason Ward
  • 125
  • 2
  • 11
1
vote
2 answers

How to compose two images (using Source In composition)?

I need to perform Source In composition on 2 images. For example this image: and a mask image (tested with black-transparent and black-white): should produce result: I am trying to do this with ImageSharp: img.Mutate(imgMaskIn => { using (var…
Makla
  • 9,899
  • 16
  • 72
  • 142
1
vote
1 answer

How ImageSharp work with Asp.Net Mvc Controller

How ImageSharp work with Dynamic Images loaded from Database? Here my controller which get image file: public async Task GetPhoto([FromQuery] GetFileAttachementInputAsync input) { var file = await filesAttachementAppService …
Hanaa Gebril
  • 187
  • 1
  • 13
1
vote
2 answers

Unable to load font for use with ImageSharp in Xamarin Android app

I have a Xamarin Forms app where I've included a font file called Roboto-Regular.ttf in the Assets folder of the Android project. Its Build Action is set to AndroidAsset. Using the SixLabors.Fonts NuGet package, I'm trying to load this font to use…
Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72