Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JimBobSquarePants committed Dec 2, 2023
1 parent 7b9f3e5 commit 6170040
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 20 deletions.
76 changes: 69 additions & 7 deletions products/imagesharp-drawing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ <h1 class="mb-3">

<section>
<div class="container">
<div class="row">
<div class="col">
<p class="mb-3">
<strong>Revolutionize your graphics with ImageSharp.Drawing</strong>, the ideal solution for dynamic design and development. It blends intuitive design with powerful functionality, making it perfect for developers seeking precision and ease. Embrace the art of simplicity with ImageSharp.Drawing
</p>
</div>
</div>
<div class="row">
<div class="col">
<h3 class="display-5">Install anywhere</h3>
Expand All @@ -208,7 +215,7 @@ <h3 class="display-5">Install anywhere</h3>
anywhere that supports
<a
href="https://docs.microsoft.com/en-us/dotnet/standard/net-standard"
>.NET Standard 2.0+</a
>.NET 6+</a
>, ImageSharp.Drawing can be used in device, cloud, and embedded/IoT
scenarios.
</p>
Expand All @@ -225,11 +232,15 @@ <h3 class="display-5">Install anywhere</h3>
<div class="container">
<div class="row">
<div class="col order-md-last">
<h3 class="display-5">An API for everyone</h3>
<h3 class="display-5">Powerfully Simple:<br/>An API for Everyone</h3>
<p>
Experience the unmatched combination of power and simplicity with ImageSharp.Drawing.
Engineered for peak developer experience, its API redefines ease of use, offering unparalleled flexibility
and extensibility.
</p>
<p>
ImageSharp.Drawings's API is unparalleled for it's ease of use; designed
from the ground up to be flexible and extensible.
Easily draw complex shapes with our intuitive commands.
Master the art of drawing complex shapes effortlessly with our intuitive command suite.
ImageSharp.Drawing is where simplicity meets sophistication, making advanced graphics accessible to all.
</p>
</div>
<div class="col order-md-first">
Expand All @@ -239,15 +250,15 @@ <h3 class="display-5">An API for everyone</h3>
using SixLabors.ImageSharp.Processing;

using Image image = new Image&lt;Rgba32&gt;(100, 100);
var star = new Star(50, 50, 5, 20, 45);
Star star = new(50, 50, 5, 20, 45);
PointF[] points = star.Points.ToArray();
Color[] colors =
{
Color.Red, Color.Yellow, Color.Green, Color.Blue, Color.Purple,
Color.Red, Color.Yellow, Color.Green, Color.Blue, Color.Purple
};

var brush = new PathGradientBrush(points, colors, Color.White);
PathGradientBrush brush = new(points, colors, Color.White);

image.Mutate(x => x.Fill(brush));
image.Save("star.png");</code></pre>
Expand All @@ -256,7 +267,58 @@ <h3 class="display-5">An API for everyone</h3>
</div>
</div>
</section>
<section>
<div class="container">
<div class="row">
<div class="col">
<h3 class="display-5">Revolutionizing Text Graphics</h3>
<p>
With its cutting-edge text rendering, ImageSharp.Drawing leads the .NET ecosystem.
Its mastery of bi-directional (BIDI) text seamlessly integrates diverse scripts, essential for global reach.
The library boasts advanced rich text features like underlining, overlining, strikethrough, with custom brushes, elevating
text styling to new heights. Its versatility shines with both vertical and horizontal text support, catering to any design need.
</p>
<p>
This makes it a transformative tool for high-impact visuals, ensuring crisp, clear typography across all platforms and resolutions.
<p>
</div>
<div class="col">
<div class="frame">
<pre><code class="language-c#">using SixLabors.Fonts;
using SixLabors.Fonts.Unicode;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Drawing.Processing;

Font font = CreateFont("OpenSans-Regular.ttf", 36);
Font fallback = CreateFont("NotoSansKR-Regular.otf", 36);

const string text = "한국어 hangugeo";
RichTextOptions textOptions = new(font)
{
FallbackFontFamilies = new[] { fallback.Family },
LayoutMode = LayoutMode.VerticalLeftRight,
TextRuns = new[]
{
new RichTextRun()
{
Start = 0,
End = text.GetGraphemeCount(),
TextDecorations = TextDecorations.Underline
}
}
};

FontRectangle bounds = TextMeasurer.MeasureSize(text, textOptions);
using Image&lt;Rgba32&gt; img = new((int)Math.Ceiling(bounds.Width), (int)Math.Ceiling(bounds.Height));
img.Mutate(x => x.Fill(Color.White).DrawText(textOptions, text, Brushes.Solid(Color.Black)));

img.Save("rich-text.png");</code></pre>
</div>
</div>
</div>
</div>
</section>
</main>

<footer class="sl-footer p-3 p-md-5 mt-5 bg-light text-center text-sm-start">
Expand Down
28 changes: 15 additions & 13 deletions products/imagesharp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Six Labors : ImageSharp</title>
<meta name="description" content="A modern, fully featured, fully managed, cross-platform, 2D graphics library for.NET.">
<meta name="description" content="A modern, fully featured, fully managed, cross-platform, 2D graphics library for .NET.">
<link rel="preconnect" href="https://fonts.gstatic.com"/>
<link
rel="stylesheet"
Expand Down Expand Up @@ -184,7 +184,7 @@ <h1 class="mb-3">
ImageSharp
</h1>
<p class="lead mb-4">
A modern, fully featured, fully managed, cross-platform, 2D graphics library for.NET.
A modern, fully featured, fully managed, cross-platform, 2D graphics library for .NET.
</p>

<div class="d-flex flex-column flex-md-row">
Expand All @@ -199,6 +199,13 @@ <h1 class="mb-3">

<section>
<div class="container">
<div class="row">
<div class="col">
<p class="mb-3">
<strong>Boost your projects with ImageSharp, the ultimate image processing tool for the modern .NET development stack</strong>. Its powerful, agile, and user-friendly features accelerate your workflow, ensuring seamless integration and top-notch performance.
</p>
</div>
</div>
<div class="row">
<div class="col">
<h3 class="display-5">Install anywhere</h3>
Expand Down Expand Up @@ -237,7 +244,7 @@ <h3 class="display-5">An API for everyone</h3>
<pre><code class="language-c#">using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;

using var image = Image.Load("original.jpg");
using Image image = Image.Load("original.jpg");
image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2));
image.Save("result.jpg");</code></pre>
</div>
Expand All @@ -256,11 +263,11 @@ <h3 class="display-5">A powerful feature set</h3>
</p>
<ul>
<li>
Complete support for jpeg, bmp, gif, pbm, png, tga, tiff, and webp with more
Complete support for jpeg, bmp, gif, pbm, png, tga, tiff, webp, and qoi with more
formats on the way.
</li>
<li>Supports over 25 different pixel formats.</li>
<li>Metadata editing support (IPTC EXIF).</li>
<li>Metadata editing support (IPTC EXIF, XMP).</li>
<li>
Colorspace transforms (RGB/CMYK/Grayscale/CIELab and many
more).
Expand All @@ -277,17 +284,12 @@ <h3 class="display-5">A powerful feature set</h3>
<pre><code class="language-c#">using SixLabors.ImageSharp.Formats.Gif;
using SixLabors.ImageSharp.Metadata;

const int frameDelay = 42;
const int colorTableLength = 128;
const GifDisposalMethod disposalMethod = GifDisposalMethod.RestoreToBackground;

using var image = await Image.LoadAsync("original.gif");
using Image image = await Image.LoadAsync("original.gif");
foreach (ImageFrame frame in image.Frames)
{
GifFrameMetadata metaData = frame.Metadata.GetGifMetadata();
metaData.FrameDelay = frameDelay;
metaData.ColorTableLength = colorTableLength;
metaData.DisposalMethod = disposalMethod;
metaData.FrameDelay = 42;
metaData.DisposalMethod = GifDisposalMethod.RestoreToBackground;
}

await image.SaveAsync("result.gif");</code></pre>
Expand Down

0 comments on commit 6170040

Please sign in to comment.