---
title: "How to Export Excel Chart to Image in C#: PNG & JPEG Formats"
published_at: "2025-09-04T16:51:46+00:00"
modified_at: "2026-01-02T14:08:06+00:00"
url: "https://www.syncfusion.com/blogs/post/excel-chart-to-image"
excerpt: "Export Excel charts to image formats like PNG or JPEG using C#. Learn how to automate chart conversion in .NET with clean code examples."
taxonomy_category:
  - "Charts"
  - "Document Processing"
  - "Excel"
  - "File Formats"
taxonomy_post_tag:
  - ".NET Excel Library"
  - "C#"
  - "C# Excel chart automation"
  - "Chart to Image"
  - "Convert Excel Chart to Image"
  - "Convert Excel chart to PNG using C#"
  - "Document Processing"
  - "Excel"
  - "Excel chart rendering in .NET"
  - "Excel Chart to Image"
  - "Excel Library"
  - "Export Excel chart as JPEG"
  - "Export Excel Chart to Image"
  - "Export Excel Chart to JPEG"
  - "Export Excel Chart to PNG"
  - "File Formats"
  - "Save Excel chart as image"
---

# How to Export Excel Chart to Image in C#: PNG & JPEG Formats

[Mohan Chandran](https://www.syncfusion.com/blogs/author/mohan-chandran)

![How to Export Excel Chart to Image in C# PNG & JPEG Formats](https://www.syncfusion.com/blogs/wp-content/uploads/2025/09/How-to-Export-Excel-Chart-to-Image-in-C-PNG-JPEG-Formats.jpg)


**TL;DR:** Developers often need to convert Excel charts into image formats for reporting or sharing. This guide shows how to export Excel charts to PNG or JPEG using C# in .NET, solving a common automation challenge.

## Why export Excel Charts to an image in C#?

Exporting Excel charts as images is a common need for developers building reporting tools or dashboards. Whether you’re embedding visuals in PDFs, sending charts via email, or integrating them into web apps, having a reliable way to convert charts to image files is essential.

In this guide, you will learn how to convert Excel charts into high-quality **PNG** or**JPEG** images using the [Syncfusion® .NET Excel library](https://www.syncfusion.com/document-sdk/net-excel-library)
 in **C#**.

## Why Syncfusion® .NET Excel library?

The [.NET Excel Library](https://help.syncfusion.com/document-processing/excel/overview)
 is a robust tool that facilitates the smooth creation, reading, and editing of Excel documents using C#. It supports the creation of Excel documents from scratch, modifying existing Excel documents, data import and export, Excel formulas, conditional formats, data validations, charts, sparklines, tables, pivot tables, pivot charts, template markers, and much more.


## Prerequisites

To follow along, you’ll need:

- [.NET SDK 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or later
- [Syncfusion® XlsIO](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package
- [Visual Studio](https://visualstudio.microsoft.com/) or VS Code

## Step-by-step implementation

### Step 1: Create a .NET Core Console app

First, create a [.NET Core Console application](https://learn.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio?pivots=dotnet-8-0)
 in [Visual Studio](https://visualstudio.microsoft.com/)
, as shown in the following image.


.NET Core Console app


### Step 2: Install the NuGet packages

Install the latest [Syncfusion.XlsIORenderer.NET.Core](https://www.nuget.org/packages/Syncfusion.XlsIORenderer.Net.Core)
 NuGet package in your application.

### Step 3: Convert the chart to an image

Use the following code to convert the chart in the Excel document to an image using Syncfusion® .NET Excel library.

```
using System.IO;
using Syncfusion.XlsIO;
using Syncfusion.XlsIORenderer;

namespace Chart_to_Image
{
    class Program
    {
        static void Main(string[] args)
        {
            //Initialize ExcelEngine
            using (ExcelEngine excelEngine = new ExcelEngine())
            {
                //Initialize application
                IApplication application = excelEngine.Excel;

                //Set the default version as Xlsx
                application.DefaultVersion = ExcelVersion.Xlsx;

                // Initialize XlsIORenderer
                application.XlsIORenderer = new XlsIORenderer();

                //Set converter chart image format to PNG or JPEG
                application.XlsIORenderer.ChartRenderingOptions.ImageFormat = ExportImageFormat.Png;

                //Set the chart image quality to best
                application.XlsIORenderer.ChartRenderingOptions.ScalingMode = ScalingMode.Best;

                //Open existing workbook with chart
                FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read);
                IWorkbook workbook = application.Workbooks.Open(inputStream);
                IWorksheet worksheet = workbook.Worksheets[0];

                //Access the chart from the worksheet
                IChart chart = worksheet.Charts[0];

                #region Save
                //Exporting the chart as an image
                FileStream outputStream = new FileStream(Path.GetFullPath("Output/Image.png"), FileMode.Create, FileAccess.Write);
                chart.SaveAsImage(outputStream);
                #endregion

                //Dispose streams
                outputStream.Dispose();
                inputStream.Dispose();
            }
        }
    }
}
```


## Example: Exporting a sales report chart

Consider an Excel document containing a chart that visualizes a sales report. The screenshot below shows the original Excel chart.


Exporting a sales report chart in Excel

This chart is then programmatically extracted and converted into a PNG image. To export it as a JPEG instead, change the image format in code:

```
// Set the image format as JPEG
application.XlsIORenderer.ChartRenderingOptions.ImageFormat = ExportImageFormat.JPEG;
```

The screenshot below shows the converted PNG image from the chart in an Excel document.


Excel chart image output in PNG

This image can now be seamlessly integrated into mobile or web applications, email notifications, automated document generation systems, or image archives.

## Use cases

- Embed chart images in automated PDF reports for business intelligence.
- Send chart snapshots in scheduled email alerts for sales or KPIs.
- Display Excel-generated charts in web dashboards without Excel dependency.
- Archive chart visuals for audit trails or compliance documentation.
- Integrate chart images into mobile apps for lightweight analytics.
- Insert chart images into Word proposals or invoices using document automation.

## GitHub reference

You can download the complete sample from the [GitHub](https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Chart%20to%20Image/Chart%20to%20Image/.NET/Chart%20to%20Image)
 demo.


## Conclusion

Thanks for reading! In this blog, we explored how to convert [Excel charts to images](https://help.syncfusion.com/document-processing/excel/conversions/chart-to-image/overview)
 using C# with the [Syncfusion® Excel Library](https://www.syncfusion.com/document-sdk/net-excel-library)
. With it, you can also export Excel data to [PDF](https://help.syncfusion.com/document-processing/excel/conversions/excel-to-pdf/overview)
, [data tables](https://help.syncfusion.com/file-formats/xlsio/working-with-data#exporting-from-worksheet-to-data-table)
, [HTML](https://help.syncfusion.com/document-processing/excel/conversions/excel-to-html/overview)
, [CSV](https://help.syncfusion.com/document-processing/excel/conversions/excel-to-csv/overview)
, [TSV](https://help.syncfusion.com/document-processing/excel/conversions/excel-to-csv/overview)
, [collections of objects](https://help.syncfusion.com/file-formats/xlsio/working-with-data#exporting-from-worksheet-to-clr-objects)
, [ODS](https://help.syncfusion.com/document-processing/excel/conversions/excel-to-ods/overview)
, [JSON](https://help.syncfusion.com/document-processing/excel/conversions/excel-to-json/overview)
, and more file formats.

If you are new to our .NET Excel library, it is highly recommended that you follow our [guide](https://help.syncfusion.com/file-formats/xlsio/getting-started-create-excel-file-csharp-vbnet)
. Try out these conversions and share your feedback in the comment section of this blog post!

Are you already a Syncfusion® user? You can download the product setup [here](https://www.syncfusion.com/account/downloads/studio/)
. If you’re not a Syncfusion® user, you can download a free, 30-day trial [here](https://www.syncfusion.com/downloads)
.

If you have any questions or require clarification about these features, please let us know in the comments below. You can also contact us through our [support forum](https://www.syncfusion.com/forums)
, [support portal](https://support.syncfusion.com/)
, or [feedback portal](https://www.syncfusion.com/feedback/)
. We are happy to assist you!

## Related Blogs



[Easily Convert Excel to HTML in 3 Steps With C#](https://www.syncfusion.com/blogs/post/easily-convert-excel-to-html-cshrap)



[Convert Excel to PDF in Just 5 Steps Using C#](https://www.syncfusion.com/blogs/post/convert-excel-to-pdf-in-csharp)



[How to Export XML to Excel in 3 Easy Steps using C#?](https://www.syncfusion.com/blogs/post/easily-export-xml-to-excel-in-csharp)



[How to Automate Find and Replace in Excel Using C# with XlsIO Library](https://www.syncfusion.com/blogs/post/find-replace-excel-csharp)
