# Exporting PNG or TIFF charts with transparent background

**URL:** <https://forum.xltoolbox.net/t/exporting-png-or-tiff-charts-with-transparent-background/33>\
**Category:** General discussion\
**Created:** [February 26, 2014, 10:31am UTC](https://forum.xltoolbox.net/t/exporting-png-or-tiff-charts-with-transparent-background/33 "2014-02-26T10:31:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adinnes85](https://forum.xltoolbox.net/letter_avatar_proxy/v4/letter/a/da6949/32.png) [@adinnes85](https://forum.xltoolbox.net/u/adinnes85)\
**Post date:** [February 26, 2014, 10:31am UTC](https://forum.xltoolbox.net/t/exporting-png-or-tiff-charts-with-transparent-background/33/1 "2014-02-26T10:31:38Z")

</div>

I am using the VBA api to automatically export charts. Originally, I exported them as EMF files and by turning the chart background to ‘no fill’ I could get the backgrounds of the exported charts to be transparent. However, when I do the exact same export on the same charts but as PNGs instead, the charts come out with white backgrounds.

Does anyone know how I can get the charts to export as PNG files (or any web suitable image format), and keep their transparent background? As I am sure that this file format should be able to handle transparency.

Any help would be greatly appreciated. And thanks to the developer for this great piece of software!

Andrew

---

<div class="post-metadata">

**Author:** ![Daniel](https://forum.xltoolbox.net/user_avatar/forum.xltoolbox.net/daniel/32/6_2.png) [@Daniel](https://forum.xltoolbox.net/u/Daniel)\
**Post date:** [February 26, 2014, 1:05pm UTC](https://forum.xltoolbox.net/t/exporting-png-or-tiff-charts-with-transparent-background/33/2 "2014-02-26T13:05:00Z")

</div>

Hi Andrew,

the Toolbox currently cannot do this, unfortunately. Internally, it ‘asks’ Windows to draw the chart to be exported in memory, and then the FreeImage library is used to create a graphics file from this in-memory representation. Thus, the Toolbox currently has no means to interfere with the drawing of individual elements such as the chart background.

I am working on a revamped chart export engine, but it will take a while before it’s ready. I know that lots of people have come to like the Toolbox’ chart export feature, and I use it myself for my scientific work.

One workaround for the time being is to use an image manipulation software such as [http://gimp.org](http://gimp.org) to make the white background transparent.

Another workaround is to use [http://inkscape.org](http://inkscape.org) to manually delete the background rectangle, then export the image to PNG. (Coincidentally I posted an [http://xltoolbox.sf.net/blog/2014/02/export-excel-charts-to-svg-files](http://xltoolbox.sf.net/blog/2014/02/export-excel-charts-to-svg-files) about how to get Excel charts into Inkscape just yesterday.)

I know both of these methods are cumbersome if you need to export many charts, or update your charts often.

Kind regards

Daniel

---

<div class="post-metadata">

**Author:** ![Daniel](https://forum.xltoolbox.net/user_avatar/forum.xltoolbox.net/daniel/32/6_2.png) [@Daniel](https://forum.xltoolbox.net/u/Daniel)\
**Post date:** [February 26, 2014, 1:08pm UTC](https://forum.xltoolbox.net/t/exporting-png-or-tiff-charts-with-transparent-background/33/3 "2014-02-26T13:08:16Z")

</div>

Oh well, just realized you are using the API. So it’s probably not feasible to manually work with the exported charts…

---

<div class="post-metadata">

**Author:** ![adinnes85](https://forum.xltoolbox.net/letter_avatar_proxy/v4/letter/a/da6949/32.png) [@adinnes85](https://forum.xltoolbox.net/u/adinnes85)\
**Post date:** [February 27, 2014, 11:01am UTC](https://forum.xltoolbox.net/t/exporting-png-or-tiff-charts-with-transparent-background/33/4 "2014-02-27T11:01:44Z")

</div>

Thanks Daniel. I’ll give your workarounds a shot. Cheers

---

<div class="post-metadata">

**Author:** ![Daniel](https://forum.xltoolbox.net/user_avatar/forum.xltoolbox.net/daniel/32/6_2.png) [@Daniel](https://forum.xltoolbox.net/u/Daniel)\
**Post date:** [January 6, 2015, 4:52am UTC](https://forum.xltoolbox.net/t/exporting-png-or-tiff-charts-with-transparent-background/33/5 "2015-01-06T04:52:19Z")

</div>

Hi, if you’re still listening to this, try the new alpha versions (2 and higher), which support transparency.

[xltoolbox.sourceforge.net/blog/2 … he-license](http://xltoolbox.sourceforge.net/blog/2015/01/alpha-2-with-graphic-export-and-apache-license)
