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
0
votes
1 answer

How convert SixLabors.ImageSharp.Color to System.Drawing.Color?

I need to convert instance of SixLabors.ImageSharp.Color to System.Drawing.Color and backwards. How to do it?
Kemsikov
  • 452
  • 3
  • 13
0
votes
1 answer

Convert arbitrary images to RGB565 byte arrays with ImageSharp

I'm trying to translate the following code using System.Drawing to use the cross-platform ImageSharp library. Image originalImage = Image.FromFile(filename); Bitmap resizedImage = new Bitmap((int)format.Width, (int)format.Height,…
dstaley
  • 1,002
  • 1
  • 12
  • 32
0
votes
1 answer

Apply mask to image

I need to apply mask (3x3) to image manually by iterating through it and calculating new values for each pixel. My code seems to work, but there is an issue - new value might not be between 0 and 255, it can be higher or lower. Such values are not…
user18408957
0
votes
2 answers

How do I write an image's MemoryStream to the page body?

I'm converting ASP.NET WebForms code to ASP.NET Core Razor pages which is new to me. I'm trying to retrieve an image MemoryStream from a business class (based on SixLabors awesome ImageSharp) and have the page render the JPEG -- no HTML, just the…
mdelvecchio
  • 567
  • 1
  • 5
  • 25
0
votes
1 answer

How to new an Image with ImageSharp 2.0.0 in VS2017

Following the docs at the Getting Started page (although without newer language features), I have the following code: using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; public class Test { public void CreateImage() { …
jlmt
  • 1,947
  • 1
  • 13
  • 16
0
votes
1 answer

How do I extract a jpeg's EXIF thumbnail using ImageSharp?

I am trying to extract thumbnails from source jpegs and save them to the file system, using the C# ImageSharp library. I see there is some mention of it in the intellisense for the…
mdelvecchio
  • 567
  • 1
  • 5
  • 25
0
votes
0 answers

Convert a JPG or PNG to WebP in C# .NET 6

I am working in a .NET 6 application. I am already aware of the following answer, but I was looking for a solution where I wouldn't have to install .dll and manually include it in my project. That answer is from 2019, and I was wondering if there's…
J86
  • 14,345
  • 47
  • 130
  • 228
0
votes
1 answer

ImageSharp: Drawing a clipped Polygon out of bounds

I'm currently in the process of migrating a project that uses System.Drawing.Bitmap over to use ImageSharp. As part of this migration, I am migrating logic that would draw circles onto the bitmap using the Graphics.FromImage function. The problem I…
Jono_2007
  • 1,016
  • 3
  • 12
  • 23
0
votes
1 answer

Ubuntu-OS Compatible Tiff image format to Jpeg image format Convertion (.NET 5)

I want to Convert Tiff file/filestream into Jpeg file/filestream. I am curretly developing a Blazor Server app with .NET 5 in Windows. But my Server is in Ubuntu OS. I am trying to display tiff image in webpage. In order to do that I am trying to…
0
votes
1 answer

Remove Exif data from image when using Imagesharp.web

I'm using imagesharp.web. Image width/height is reduced as expected, but size not reduced to fit for web applications(Size is more that 1 MB). I found that Exif data are there in the image contributing to this size. Is there a way to remove Exif…
0
votes
1 answer

Get/set the resolution of an image file using C# net5.0 but without System.Drawing.Common?

Using System.Drawing, it is easy to get the HorizontalResolution and VerticalResolution of an image file. In .NET 6, System.Drawing.common will be disabled (by default) and unsupported in other platform than Windows. I try to get an equivalent with…
Whiletrue
  • 551
  • 1
  • 7
  • 18
0
votes
1 answer

imagesharp.web doesn't resize image or crop

Í have got imagesharp.web somewhat working. In the below it resizes the image but I can't get it to crop the image. There is a second image it doesn't resize at all. This resizes
Petras
  • 4,686
  • 14
  • 57
  • 89
0
votes
0 answers

How do you apply custom processing logic on parallel, pixel-format agnostic image manipulation on ImageSharp?

I'm trying to build a Blazor Server web app that modifies any uploaded image by ARGB pixels, using ImageSharp. So, I came across this webpage (
0
votes
2 answers

How to save an image in TIFF format?

I wonder if it's possible to save an image to TIFF format using the ImageSharp library, and if yes how to do it? I can't find any suitable methods on the Image class. image.SaveAsJpeg() (shortcut for image.Save(new JpegEncoder())) image.SaveAsPng()…
Jonas
  • 3,155
  • 5
  • 35
  • 55
0
votes
1 answer

SixLabors: converting img colorspace to sRGB

first off - im not wellversed with colorspaces so pls forgive me if im not asking the question well or if the answers really obvious i am using sixlabors imagesharp and since im getting images from all different and random sources i want to check…
toy
  • 422
  • 1
  • 7
  • 19