Skip to content

Commit 74095c8

Browse files
Update refs and begin docs updates
1 parent 472f7ab commit 74095c8

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

articles/imagesharp/imageformats.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ ImageSharp's API however, is designed to support extension by the registration o
1717

1818
[`Image<TPixel>`](xref:SixLabors.ImageSharp.Image`1) represents raw pixel data, stored in a contiguous memory block. It does not "remember" the original image format.
1919

20-
ImageSharp identifies image formats (Jpeg, Png, Gif etc.) by [`IImageFormat`](xref:SixLabors.ImageSharp.Formats.IImageFormat) instances. There are several overloads of [`Image.Load`](xref:SixLabors.ImageSharp.Image) capable of returning the format as an `out` parameter. It's possible to pass that value to `image.Save` after performing the operation:
20+
ImageSharp identifies image formats (Jpeg, Png, Gif etc.) by [`IImageFormat`](xref:SixLabors.ImageSharp.Formats.IImageFormat) instances. Decoded images store the format in the [DecodedImageFormat](xref:SixLabors.ImageSharp.Metadata.ImageMetadata.DecodedImageFormat) within the image metadata. It is possible to pass that value to `image.Save` after performing the operation:
2121

2222
```C#
23-
IImageFormat format;
24-
25-
using (var image = Image.Load(inputStream, out format))
23+
using (var image = Image.Load(inputStream))
2624
{
2725
image.Mutate(c => c.Resize(30, 30));
28-
image.Save(outputStream, format);
26+
image.Save(outputStream, image.Metadata.DecodedImageFormat);
2927
}
3028
```
3129

@@ -45,25 +43,25 @@ using (var image = Image.Load(inputStream, out format))
4543

4644
Real life image streams are usually stored / transferred in standardized formats like Jpeg, Png, Bmp, Gif etc. An image format is represented by an [`IImageFormat`](xref:SixLabors.ImageSharp.Formats.IImageFormat) implementation.
4745

48-
- [`IImageDecoder`](xref:SixLabors.ImageSharp.Formats.IImageDecoder) is responsible for decoding streams (and files) in into [`Image<TPixel>`](xref:SixLabors.ImageSharp.Image`1). ImageSharp can **auto-detect** the image formats of streams/files based on their headers, selecting the correct [`IImageFormat`](xref:SixLabors.ImageSharp.Formats.IImageFormat) (and thus [`IImageDecoder`](xref:SixLabors.ImageSharp.Formats.IImageDecoder)). This logic is implemented by [`IImageFormatDetector`](xref:SixLabors.ImageSharp.Formats.IImageFormatDetector)'s.
49-
- [`IImageEncoder`](xref:SixLabors.ImageSharp.Formats.IImageEncoder) is responsible for writing [`Image<TPixel>`](xref:SixLabors.ImageSharp.Image`1) into a stream using a given format.
46+
- [`ImageDecoder`](xref:SixLabors.ImageSharp.Formats.ImageDecoder) is responsible for decoding streams (and files) in into [`Image<TPixel>`](xref:SixLabors.ImageSharp.Image`1). ImageSharp can **auto-detect** the image formats of streams/files based on their headers, selecting the correct [`IImageFormat`](xref:SixLabors.ImageSharp.Formats.IImageFormat) (and thus [`ImageDecoder`](xref:SixLabors.ImageSharp.Formats.ImageDecoder)). This logic is implemented by [`IImageFormatDetector`](xref:SixLabors.ImageSharp.Formats.IImageFormatDetector)'s.
47+
- [`ImageEncoder`](xref:SixLabors.ImageSharp.Formats.ImageEncoder) is responsible for writing [`Image<TPixel>`](xref:SixLabors.ImageSharp.Image`1) into a stream using a given format.
5048
- Decoders/encoders and [`IImageFormatDetector`](xref:SixLabors.ImageSharp.Formats.IImageFormatDetector)'s are mapped to image formats in [`ImageFormatsManager`](xref:SixLabors.ImageSharp.Configuration.ImageFormatsManager). It's possible to register new formats, or drop existing ones. See [Configuration](configuration.md) for more details.
5149

5250
### Metadata-only Decoding
5351

5452
Sometimes it's worth to efficiently decode image metadata ignoring the memory and CPU heavy pixel information inside the stream. ImageSharp allows this by using one of the several [Image.Identify](xref:SixLabors.ImageSharp.Image) overloads:
5553

5654
```C#
57-
IImageInfo imageInfo = Image.Identify(inputStream);
55+
ImageInfo imageInfo = Image.Identify(inputStream);
5856
Console.WriteLine($"{imageInfo.Width}x{imageInfo.Height} | BPP: {imageInfo.PixelType.BitsPerPixel}");
5957
```
6058

61-
See [`IImageInfo`](xref:SixLabors.ImageSharp.IImageInfo) for more details about the identification result. Note that [`Image<TPixel>`](xref:SixLabors.ImageSharp.Image`1) also implements `IImageInfo`.
59+
See [`ImageInfo`](xref:SixLabors.ImageSharp.ImageInfo) for more details about the identification result. Note that [`Image<TPixel>`](xref:SixLabors.ImageSharp.Image`1) also implements `ImageInfo`.
6260

6361
### Working with Encoders
6462

6563
Image formats are usually defined by complex standards allowing multiple representations for the same image. ImageSharp allows parameterizing the encoding process:
66-
[`IImageEncoder`](xref:SixLabors.ImageSharp.Formats.IImageEncoder) implementations are stateless, lightweight **parametric** objects. This means that if you want to encode a Png in a specific way (eg. changing the compression level), you need to new-up a custom [`PngEncoder`](xref:SixLabors.ImageSharp.Formats.Png.PngEncoder) instance.
64+
[`ImageEncoder`](xref:SixLabors.ImageSharp.Formats.ImageEncoder) implementations are stateless, lightweight **parametric** objects. This means that if you want to encode a Png in a specific way (eg. changing the compression level), you need to new-up a custom [`PngEncoder`](xref:SixLabors.ImageSharp.Formats.Png.PngEncoder) instance.
6765

6866
Choosing the right encoder parameters allows to balance between conflicting tradeoffs:
6967

articles/imagesharp/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Introduction
22

33
### What is ImageSharp?
4-
ImageSharp is a new, fully featured, fully managed, cross-platform, 2D graphics library.
4+
ImageSharp is a modern, fully featured, fully managed, cross-platform, 2D graphics library.
55
Designed to simplify image processing, ImageSharp brings you an incredibly powerful yet beautifully simple API.
66

77
ImageSharp is designed from the ground up to be flexible and extensible. The library provides API endpoints for common image processing operations and the building blocks to allow for the development of additional operations.
88

9-
Built against [.NET Standard 2.0](https://docs.microsoft.com/en-us/dotnet/standard/net-standard), ImageSharp can be used in device, cloud, and embedded/IoT scenarios.
9+
Built against [.NET 6](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6), ImageSharp can be used in device, cloud, and embedded/IoT scenarios.
1010

1111
### License
12-
ImageSharp is licensed under the terms of [Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0). Commercial support licensing options are available in addition to this license, see https://sixlabors.com/pricing for details.
12+
ImageSharp is licensed under the terms of the [Six Labors Split License, Version 1.0](https://github.com/SixLabors/ImageSharp/blob/main/LICENSE). See https://sixlabors.com/pricing for commercial licensing details.
1313

1414
### Installation
1515

ext/ImageSharp

Submodule ImageSharp updated 2143 files

ext/ImageSharp.Web

Submodule ImageSharp.Web updated 168 files

0 commit comments

Comments
 (0)