# RasterStoryExtensions

Encodes static or animated pixel inputs using the core GIF and APNG encoders.

 Class  

`ChartForgeX.Raster`

**Namespace**

`ChartForgeX.Raster`

**Assembly**

`ChartForgeX.Stories`

**Source**

[RasterStoryExtensions.cs:10](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Raster/RasterStoryExtensions.cs#L10)

**Modifiers**

static

Encodes static or animated pixel inputs using the core GIF and APNG encoders.

## Inheritance

- object
- RasterStoryExtensions

 Filter members   

    Show inherited   

 

## Methods

 `public static void SaveGif(RgbaImage image, string path)` [#](#method-savegif-chartforgex-raster-rgbaimage-string) 

[RasterStoryExtensions.cs:30](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Raster/RasterStoryExtensions.cs#L30)

Saves one RGBA image as a single-frame GIF.

Parameters

**image ChartForgeX.Raster.RgbaImage required**

**path string required**

 `public static byte[] ToApng(IReadOnlyList<RgbaImage> frames, int delayCentiseconds = 10, bool loop = true)` [#](#method-toapng-collections-generic-ireadonlylist-chartforgex-raster-rgbaimage-int32-boolean) 

[RasterStoryExtensions.cs:22](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Raster/RasterStoryExtensions.cs#L22)

Encodes ordered, equally sized frames as animated PNG.

Parameters

**frames System.Collections.Generic.IReadOnlyList<ChartForgeX.Raster.RgbaImage> required**

One or more complete RGBA canvases with matching dimensions.

**delayCentiseconds int = 10 optional**

A nonnegative delay applied to every frame, up to 6,553,500 centiseconds. Zero is preserved.

**loop bool = true optional**

Repeats indefinitely when true; otherwise plays once.

Returns

 `byte[]` 

 ToGif 2 overloads 

 `public static byte[] ToGif(RgbaImage image)` [#](#method-togif-chartforgex-raster-rgbaimage) 

[RasterStoryExtensions.cs:10](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Raster/RasterStoryExtensions.cs#L10)

Encodes one RGBA image as a single-frame GIF.

Parameters

**image ChartForgeX.Raster.RgbaImage required**

Returns

 `byte[]` 

 `public static byte[] ToGif(IReadOnlyList<RgbaImage> frames, int delayCentiseconds = 10, bool loop = true)` [#](#method-togif-collections-generic-ireadonlylist-chartforgex-raster-rgbaimage-int32-boolean) 

[RasterStoryExtensions.cs:16](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Raster/RasterStoryExtensions.cs#L16)

Encodes ordered, equally sized frames as GIF.

Parameters

**frames System.Collections.Generic.IReadOnlyList<ChartForgeX.Raster.RgbaImage> required**

One or more complete RGBA canvases with matching dimensions.

**delayCentiseconds int = 10 optional**

A nonnegative delay applied to every frame, up to 65,535 centiseconds. Zero is preserved.

**loop bool = true optional**

Repeats indefinitely when true; otherwise plays once.

Returns

 `byte[]` 

 `public static void WriteGif(RgbaImage image, Stream stream)` [#](#method-writegif-chartforgex-raster-rgbaimage-io-stream) 

[RasterStoryExtensions.cs:25](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Raster/RasterStoryExtensions.cs#L25)

Writes one RGBA image as a single-frame GIF.

Parameters

**image ChartForgeX.Raster.RgbaImage required**

**stream System.IO.Stream required**

## 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:28A0BD3F3749E0D2BD697BD5E5B8E4C62943B6A5EEAA4C44C2A009229FCF5955 -->
