Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Transparent background with PNG

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96930] Re: Transparent background with PNG
  • From: igorantonio at gmail.com
  • Date: Fri, 27 Feb 2009 06:15:19 -0500 (EST)
  • References: <gnm1o0$hgg$1@smc.vnet.net>

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