sixlabors / docs Goto Github PK
View Code? Open in Web Editor NEWAPI docs and tutorials on how to use ImagesSharp and related projects.
Home Page: https://docs.sixlabors.com
API docs and tutorials on how to use ImagesSharp and related projects.
Home Page: https://docs.sixlabors.com
DEBUG
and RELEASE
modeThe documentation is barly usable since most of the navigation items are cut off no matter how big the screen size is.
The column can't be resized so in order to read where to navigat to one has to hover over every single item.
https://i.imgur.com/xZUW0su.png
Windows 11; Edge & Firefox
DEBUG
and RELEASE
modeWhen clicking drawing in the documentation website nothing happens:
DEBUG
and RELEASE
mode I have only observed this using the nuget package and does reproduce in both debug and release builds of test appIf you attempt to perform operations (like use the SixLabors.ImageSharp.Processing.FillRectangleExtensions.Fill
method) within a Parallel.For
loop, many of the changes appear to be lost.
This appears to constantly reproduce the problem
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta0007" />
</ItemGroup>
</Project>
using System;
using System.Threading.Tasks;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.Primitives;
namespace ParallelImage
{
class Program
{
static void Main(string[] args)
{
const int width = 12;
const int rowHight = 16;
const int rows = 10;
const string fileName = "out.jpg";
using (Image<Rgb24> startImage = new Image<Rgb24>(Configuration.Default, width, rowHight * rows, Color.White))
{
using(Image<Rgb24> clonedImage = startImage.Clone(clone => {
Parallel.For(
fromInclusive: 0,
toExclusive: rows,
new ParallelOptions { MaxDegreeOfParallelism = args?.Length == 1 ? int.Parse(args[0]) : -1 },
(row) =>
{
clone.Fill(Color.Black, new RectangleF(0, row * rowHight, width, rowHight));
});
}))
{
clonedImage.Save(fileName);
Rgb24 black = Color.Black.ToPixel<Rgb24>();
int count = 0;
foreach(Rgb24 pixel in clonedImage.GetPixelSpan())
{
count++;
if (pixel.R != black.R)
{
Console.WriteLine(count.ToString());
return;
}
}
Console.WriteLine("No problems found");
}
}
}
}
}
This will create an image with a white background, and then draw black rectangles down the full height of the image. The image will be saved under 'out.jpg'. Then all the pixels are checked and reports the position of the first non-black one it finds.
dotnet run
should demonstrate the problem by reporting the index of the first non-black pixel.
Running dotnet run 1
(which will set the MaxDegreeOfParallelism
for the Parallel.For
) will correctly set all of the pixels to black and will display No problems found
~/Test/ParallelImage > dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.101
Commit: b377529961
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.101/
Host (useful for support):
Version: 3.1.1
Commit: a1388f194c
.NET Core SDKs installed:
3.0.100 [/usr/local/share/dotnet/sdk]
3.0.101 [/usr/local/share/dotnet/sdk]
3.1.100 [/usr/local/share/dotnet/sdk]
3.1.101 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Hi. Thank you for all the work you do with this library.
I wanted to use the rxy querystring when cropping images, but couldn't get it to work.
(https://github.com/SixLabors/docs/blob/master/articles/imagesharp.web/processingcommands.md/).
The sample code is "&rxy=30,30". But it's not clear in the documentation if that is pixels or percentage, or something else.
After some testing it seems that the values should actually be between 0-1. So, the sample querystring should be "&rxy=0.30,0.30" if you want the anchor point to be 30% top and 30% left?
I'm happy to do a PR to update the docs (provided I'm not wrong ๐).
Certain True Type fonts only display correctly with hinting enabled. We should document a list.
See SixLabors/Fonts#340 (comment)
DEBUG
and RELEASE
modeThis code works correctly and gives me my normal map....
var heightMap = heightMapResult.Data;
Rgba32[] normals = heightMap.normals.Select(norm => new Rgba32(){
R = (byte)(norm.X * 255), G = (byte)(norm.Y * 255), B = (byte)(norm.Z * 255), A = 255
}).ToArray();
using(var image = Image.LoadPixelData<Rgba32>(normals, heightMap.Width, heightMap.Height))
{
await image.SaveAsPngAsync(_args.OutputFolder + "/normal-map.png");
}
But the getting started document forgets the width and height parameters.
.net core 2.1, windows 10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.