# RasterImageDecoder

Decodes dependency-free raster image formats into RGBA pixels.

 Class  

`ChartForgeX.Raster`

**Namespace**

`ChartForgeX.Raster`

**Assembly**

`ChartForgeX`

**Source**

[RasterImageDecoder.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L11)

**Modifiers**

static

Decodes dependency-free raster image formats into RGBA pixels.

## Inheritance

- object
- RasterImageDecoder

 Filter members   

    Show inherited   

 

## Methods

 Decode 2 overloads 

 `public static RgbaImage Decode(byte[] data)` [#](#method-decode-byte) 

[RasterImageDecoder.cs:38](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L38)

Decodes raster image bytes into RGBA pixels.

Parameters

**data byte[] required**

The encoded image bytes.

Returns

 `RgbaImage` The decoded RGBA image. 

 `public static RgbaImage Decode(byte[] data, RasterDecodeOptions? options)` [#](#method-decode-byte-chartforgex-raster-rasterdecodeoptions) 

[RasterImageDecoder.cs:41](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L41)

Decodes raster bytes with explicit encoded-input and pixel limits.

Parameters

**data byte[] required**

**options ChartForgeX.Raster.RasterDecodeOptions? required**

Returns

 `RgbaImage` 

 Read 4 overloads 

 `public static RgbaImage Read(string path)` [#](#method-read-string) 

[RasterImageDecoder.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L11)

Reads and decodes a raster image file.

Parameters

**path string required**

The source image path.

Returns

 `RgbaImage` The decoded RGBA image. 

 `public static RgbaImage Read(string path, RasterDecodeOptions? options)` [#](#method-read-string-chartforgex-raster-rasterdecodeoptions) 

[RasterImageDecoder.cs:14](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L14)

Reads a raster file with explicit encoded-input and pixel limits.

Parameters

**path string required**

**options ChartForgeX.Raster.RasterDecodeOptions? required**

Returns

 `RgbaImage` 

 `public static RgbaImage Read(Stream stream)` [#](#method-read-io-stream) 

[RasterImageDecoder.cs:27](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L27)

Reads and decodes a raster image stream.

Parameters

**stream System.IO.Stream required**

The source image stream.

Returns

 `RgbaImage` The decoded RGBA image. 

 `public static RgbaImage Read(Stream stream, RasterDecodeOptions? options)` [#](#method-read-io-stream-chartforgex-raster-rasterdecodeoptions) 

[RasterImageDecoder.cs:31](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L31)

Reads a raster stream with explicit limits without closing the caller's stream.

Parameters

**stream System.IO.Stream required**

**options ChartForgeX.Raster.RasterDecodeOptions? required**

Returns

 `RgbaImage` 

 TryDecode 2 overloads 

 `public static bool TryDecode(byte[]? data, out RgbaImage image)` [#](#method-trydecode-byte-chartforgex-raster-rgbaimage) 

[RasterImageDecoder.cs:99](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L99)

Attempts to decode raster image bytes.

Parameters

**data byte[]? required**

The encoded image bytes.

**image ChartForgeX.Raster.RgbaImage required**

The decoded RGBA image when successful.

Returns

 `bool` true when the image could be decoded. 

 `public static bool TryDecode(byte[]? data, RasterDecodeOptions? options, out RgbaImage image)` [#](#method-trydecode-byte-chartforgex-raster-rasterdecodeoptions-chartforgex-raster-rgbaimage) 

[RasterImageDecoder.cs:103](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L103)

Attempts to decode bytes within explicit raster limits.

Parameters

**data byte[]? required**

**options ChartForgeX.Raster.RasterDecodeOptions? required**

**image ChartForgeX.Raster.RgbaImage required**

Returns

 `bool` 

 TryRead 4 overloads 

 `public static bool TryRead(string? path, out RgbaImage image)` [#](#method-tryread-string-chartforgex-raster-rgbaimage) 

[RasterImageDecoder.cs:59](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L59)

Attempts to read and decode a raster image file.

Parameters

**path string? required**

The source image path.

**image ChartForgeX.Raster.RgbaImage required**

The decoded RGBA image when successful.

Returns

 `bool` true when the image could be decoded. 

 `public static bool TryRead(string? path, RasterDecodeOptions? options, out RgbaImage image)` [#](#method-tryread-string-chartforgex-raster-rasterdecodeoptions-chartforgex-raster-rgbaimage) 

[RasterImageDecoder.cs:63](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L63)

Attempts to decode a file within explicit raster limits.

Parameters

**path string? required**

**options ChartForgeX.Raster.RasterDecodeOptions? required**

**image ChartForgeX.Raster.RgbaImage required**

Returns

 `bool` 

 `public static bool TryRead(Stream? stream, out RgbaImage image)` [#](#method-tryread-io-stream-chartforgex-raster-rgbaimage) 

[RasterImageDecoder.cs:81](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L81)

Attempts to read and decode a raster image stream.

Parameters

**stream System.IO.Stream? required**

The source image stream.

**image ChartForgeX.Raster.RgbaImage required**

The decoded RGBA image when successful.

Returns

 `bool` true when the image could be decoded. 

 `public static bool TryRead(Stream? stream, RasterDecodeOptions? options, out RgbaImage image)` [#](#method-tryread-io-stream-chartforgex-raster-rasterdecodeoptions-chartforgex-raster-rgbaimage) 

[RasterImageDecoder.cs:85](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterImageDecoder.cs#L85)

Attempts to decode a stream within explicit raster limits without closing it.

Parameters

**stream System.IO.Stream? required**

**options ChartForgeX.Raster.RasterDecodeOptions? required**

**image ChartForgeX.Raster.RgbaImage required**

Returns

 `bool` 

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

<!-- PowerForge markdown artifact sha256:482376384CA5103DA41D3677891C91F53B10C34A64D2970801E048EBFAEA567B -->
