Code Monkey home page Code Monkey logo

samples's Introduction

Samples

General samples for various Six Labors projects

ImageSharp

Various ImageSharp related samples can be found in the ImageSharp folder

samples's People

Contributors

alanparr avatar antonfirsov avatar jimbobsquarepants avatar sei-jmattson avatar stefannikolei avatar tocsoft avatar woutware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samples's Issues

Gif manipulation sample

once SixLabors/ImageSharp#344 is merged and released to nuget create a sample manipulating frames for gifs.

Things to cover:

  • Add Frame clones the source frame
  • Export removes a frame
  • Can't export last frame
  • Show saving all frame from image

How to set the image rounded transparent background ?

I followed the example given by github to generate the circular image.
However, the generated image has a blac background after being exported
How do I set a transparent background?
var logoRequest = (HttpWebRequest)WebRequest.Create("https://vip.ztan.net/upload/image/2023-0209/384134265131077.png"); HttpWebResponse logoResponse = (HttpWebResponse)logoRequest.GetResponse(); using Stream logoResponseStream = logoResponse.GetResponseStream(); var logo = Image.Load(logoResponseStream); logo= logo.Clone(x => x.ConvertToAvatar(new Size(80, 80), 80 / 2)); using var stream = new MemoryStream(); await logo.SaveAsync(stream, new PngEncoder()); stream.Position = 0; return stream.ToArray();
ConvertToAvatar code refer to https://github.com/SixLabors/Samples/blob/main/ImageSharp/AvatarWithRoundedCorner/Program.cs

c2896e5d-ff66-480a-b6e2-d45fec0f8187

Compilation error SixLabors.ImageSharp

When I started to use SixLabors.ImageSharp I just past code from samples
I got an error: The type or namespace name 'IPathCollection' could not be found.

Also same about IPath, PathCollection, RectangularPolygon, EllipsePolygon and Size

Crop image sample

  • Is there a sample of how to crop an image file to generate thumbnail?

Fonts package referenced in sample projects is outdated

The projects are still referencing beta 19 of Fonts packages.
Further issue is that upgrading to Fonts v1.0.0. breaks some samples e.g.
Method not found: 'Void SixLabors.Fonts.IGlyphRenderer.BeginText(SixLabors.Fonts.FontRectangle)'. in DrawingTextAlongAPath

AvatarWithRoundedCorner not transparent

It seems, that the rounded corner sample is not working well with photo images. The cut out corners are not transparent for a lot of images. Cliparts are usually ok, but real world images tend to produce black corners.

sprinkles

fb-round

TextGraphicsOptions

TextGraphicsOptions reference
Excuse me, if TextGraphicsOptions is not found, which library should I refer to?

Simple samples

What about some simple examples that can be used day-by-day, like how to convert from System.Drawing formats to ImageSharp formats and vice versa?
Like how to construct a SixLabors.ImageSharp.Image from System.Drawing.Bitmap in memory?
I am having a hard time using ImageSharp for saving/loading/processing while having to display the results in the System.Drawing space.

Compilation error

I have an error

Function ConvertToAvatar have this IImageProcessingContext processingContext but in example how to use you use Image and I got 'IImageProcessingContext' does not contain a definition for 'ConvertToAvatar' and no accessible extension method 'ConvertToAvatar' accepting a first argument of type 'IImageProcessingContext' could be found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.