---
title: "Load a TIFF from byte array in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-byte-array-tiff/"
md_url: "https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-byte-array-tiff.md"
last_updated: "2026-06-09T10:25:14.424Z"
description: "Discover how to load various image formats from byte arrays in .NET, including BMP, SVG, DICOM, and TIFF. Enhance your imaging applications today!"
---

# Load a TIFF from a byte array in C#

### Image

[Image](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-byte-array-image.md)

### Bitmap

[Bitmap](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-byte-array-bitmap.md)

### SVG

[SVG](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-byte-array-svg.md)

### DICOM

[DICOM](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-byte-array-dicom.md)

### TIFF

[TIFF](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-byte-array-tiff.md)

To load a TIFF image from a byte array, use the [`CreateGdPictureImageFromByteArray` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~CreateGdPictureImageFromByteArray.html) of the [`GdPictureImaging` class](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging.html).

This method returns a non-zero GdPicture image identifier (`imageID`) on success. If it fails, it returns `0` — use `GetStat()` to view the failure reason.

Overloads:

- `CreateGdPictureImageFromByteArray(byte[] Data)`

- `CreateGdPictureImageFromByteArray(byte[] Data, DocumentFormat ImageFormat)`

For TIFF data, you can explicitly pass `DocumentFormat.DocumentFormatTIFF`.

If the TIFF contains multiple pages, you can use:

- The [`TiffGetPageCount` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TiffGetPageCount.html)

- The [`TiffSelectPage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TiffSelectPage.html)

When you no longer need the image resource, release it with the [`ReleaseGdPictureImage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~ReleaseGdPictureImage.html).

To load a TIFF image from a byte array, use the following code:

### C#

```csharp

using GdPicture14;
using System;
using System.IO;

using GdPictureImaging gdpictureImaging = new GdPictureImaging();

// Create a byte array from a TIFF image file.
byte[] byteArray = File.ReadAllBytes(@"C:\temp\source.tif");

// Create a GdPicture image from the byte array.
int imageID = gdpictureImaging.CreateGdPictureImageFromByteArray(
    byteArray,
    DocumentFormat.DocumentFormatTIFF);

if (imageID == 0)
{
    Console.WriteLine($"CreateGdPictureImageFromByteArray failed: {gdpictureImaging.GetStat()}");
    return;
}

int pageCount = gdpictureImaging.TiffGetPageCount(imageID);
if (pageCount > 1)
{
    GdPictureStatus selectStatus = gdpictureImaging.TiffSelectPage(imageID, 1);
    if (selectStatus!= GdPictureStatus.OK)
    {
        Console.WriteLine($"TiffSelectPage failed: {selectStatus}");
        gdpictureImaging.ReleaseGdPictureImage(imageID);
        return;
    }
}

GdPictureStatus saveStatus = gdpictureImaging.SaveAsPNG(imageID, @"C:\temp\output.png");
if (saveStatus!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAsPNG failed: {saveStatus}");
}

gdpictureImaging.ReleaseGdPictureImage(imageID);

```

### VB.NET

```vb

Imports GdPicture14
Imports System.IO

Using gdpictureImaging As New GdPictureImaging()
    ' Create a byte array from a TIFF image file.
    Dim byteArray As Byte() = File.ReadAllBytes("C:\temp\source.tif")

    ' Create a GdPicture image from the byte array.
    Dim imageID As Integer = gdpictureImaging.CreateGdPictureImageFromByteArray(
        byteArray,
        DocumentFormat.DocumentFormatTIFF)

    If imageID = 0 Then
        Console.WriteLine($"CreateGdPictureImageFromByteArray failed: {gdpictureImaging.GetStat()}")
        Return
    End If

    Dim pageCount As Integer = gdpictureImaging.TiffGetPageCount(imageID)
    If pageCount > 1 Then
        Dim selectStatus As GdPictureStatus = gdpictureImaging.TiffSelectPage(imageID, 1)
        If selectStatus <> GdPictureStatus.OK Then
            Console.WriteLine($"TiffSelectPage failed: {selectStatus}")
            gdpictureImaging.ReleaseGdPictureImage(imageID)
            Return
        End If
    End If

    Dim saveStatus As GdPictureStatus = gdpictureImaging.SaveAsPNG(imageID, "C:\temp\output.png")
    If saveStatus <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAsPNG failed: {saveStatus}")
    End If

    gdpictureImaging.ReleaseGdPictureImage(imageID)
End Using

```
---

## Related pages

- [Load a bitmap (BMP) from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-bitmap.md)
- [Load images from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-image.md)
- [Load a DICOM image from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-dicom.md)
- [Load an image from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-image.md)
- [Load a DICOM image from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-dicom.md)
- [Load a bitmap (BMP) from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-bitmap.md)
- [Load images using the API in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-more.md)
- [Load a vector image (SVG) from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-svg.md)
- [Load a TIFF from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-tiff.md)
- [Load a bitmap (BMP) from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-bitmap.md)
- [Load a vector image (SVG) from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-svg.md)
- [Load a DICOM image from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-dicom.md)
- [Load a TIFF from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-tiff.md)
- [Load an image from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-image.md)
- [Load a bitmap (BMP) from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-bitmap.md)
- [Load a vector image (SVG) from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-svg.md)
- [Load a vector image (SVG) from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-svg.md)
- [Load a TIFF from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-tiff.md)
- [Load a DICOM image from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-dicom.md)
- [Load an image from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-image.md)

