MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Transparent background with PNG


Hi,

Try

gr = Rasterize[expr, Background->None] (documented)
Export["file.png", gr]

Your expr needs to be something that can rasterized, such as a
Graphics expression.
Rasterizing something that's already a raster (Graphics[Raster[...]])
or Image expression is not going to work.

An undocumented shortcut:  Export["file.png", expr, Background->None]
will do the same thing.

Igor

On Feb 20, 4:47 am, replicator... at gmail.com wrote:
> Hi,
>
> how can I save an image toPNGformat (eg. a simple plot), with the
> (white) background being transparent? I understand thatPNGexport
> supports alpha channel, but have no clue how to instruct Mathematica
> to exploit it.
>
> Thanks in advance
>
> Istvan Zachar



  • Prev by Date: Re: Galois resolvent
  • Next by Date: FindRoot and evaluations
  • Previous by thread: Re: Transparent background with PNG
  • Next by thread: Re: Transparent background with PNG