Re: [GRASS-user] translucency and svg output

2010-03-25 Thread Hamish
pete davidson wrote:
 The only workaround I've managed to find so far is to export each layer
 as an individual svg,

with v.out.svg?


Hamish



  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] translucency and svg output

2010-03-25 Thread Vincent Bain
Pete, sorry if I'm off board :
do you absolutely need to generate a /vector/ output ?

Vincent.

Le mercredi 24 mars 2010 à 20:15 -0700, pete davidson a écrit :
 On Wed, Mar 24, 2010 at 7:49 PM, pete davidson caiti...@gmail.com
 wrote:
 
 
 
 On Wed, Mar 24, 2010 at 7:42 PM, Glynn Clements
 gl...@gclements.plus.com wrote:
 
 pete davidson wrote:
 
  I'm producing maps in svg format using the cairo
 driver and d.out.file.  One
  thing I'd really like to be able to do is set one or
 more of the vector
  layers to be partially translucent.  After rummaging
 through this list, I'm
  beginning to wonder if its possible at all, since
 translucency in the guis
  seems to be handled by g.pnmcomp, but perhaps
 someone with more experience
  knows a way to do it.
 
 
 It isn't. The graphics API doesn't support an alpha
 component.
 
 Apart from anything else, it can't easily be
 implemented for
 PostScript output, as PostScript doesn't support
 translucency. Faking
 it with patterns is possible, but it starts getting
 complicated if you
 want more than one translucent layer.
 
  The only workaround I've managed to find so far is
 to export each layer as
  an individual svg, then use something like inkscape
 to rejoin them, setting
  the translucency/transparency of each layer as I do
 it.  Which is fine for a
  map with only a few layers, but gets tedious when
 dealing with maps with
  dozens of layers.
 
 
 SVG is XML, so it shouldn't be especially hard to
 automate the process
 using generic XML-processing tools.
 
 Ohh, I hadn't thought of editing the svg/xml directly.  Thanks
 for the suggestion, I'll see what I can achieve from there.
 
 
 And then we discover that the 'svg' produced by cairo using the above
 script is actually just a png in an svg wrapper..  At least for my
 particular install of Grass.  That's frustrating.  Ahh well, back to
 the drawing board.
 
 Peter
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] translucency and svg output

2010-03-25 Thread pete davidson
Thanks to all for these suggestions and comments.

I will look at the options suggested by Andreas, and follow Glynn's comment
to explore why Cairo dropped to rasterization - it's good to know that
*that's* why I got raster output, rather than wrapping a raster being all
that Cairo does!

To answer Hamish, no, I was exporting each individual layer using d.vect and
d.out.file.  Your question gives me the idea I should try using v.out.svg
for individual layers to help work out why Cairo dropped to raster output
and/or to produce individual layers to stitch together later if necessary.

Re Vincent's comment that holding vector format to 'the very end',
unfortunately what I'm doing isn't for single-use - I'm producing maps that
will be used by several end users for uses ranging from conference posters
to individual papers, so I can't predict final image sizes in advance (and
I'm not going to be the only end-user).  Hence my desire to stick to a
vector format in the hopes that they'll at least scale cleanly.  Although if
Vincent is willing to share an example script that uses imagemagik to
compose ps layers I'd be delighted to see it.

Thanks again to all for sharing your thoughts  expertise.

Peter
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] translucency and svg output

2010-03-24 Thread Glynn Clements

pete davidson wrote:

 I'm producing maps in svg format using the cairo driver and d.out.file.  One
 thing I'd really like to be able to do is set one or more of the vector
 layers to be partially translucent.  After rummaging through this list, I'm
 beginning to wonder if its possible at all, since translucency in the guis
 seems to be handled by g.pnmcomp, but perhaps someone with more experience
 knows a way to do it.

It isn't. The graphics API doesn't support an alpha component.

Apart from anything else, it can't easily be implemented for
PostScript output, as PostScript doesn't support translucency. Faking
it with patterns is possible, but it starts getting complicated if you
want more than one translucent layer.

 The only workaround I've managed to find so far is to export each layer as
 an individual svg, then use something like inkscape to rejoin them, setting
 the translucency/transparency of each layer as I do it.  Which is fine for a
 map with only a few layers, but gets tedious when dealing with maps with
 dozens of layers.

SVG is XML, so it shouldn't be especially hard to automate the process
using generic XML-processing tools.

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] translucency and svg output

2010-03-24 Thread pete davidson
On Wed, Mar 24, 2010 at 7:42 PM, Glynn Clements gl...@gclements.plus.comwrote:


 pete davidson wrote:

  I'm producing maps in svg format using the cairo driver and d.out.file.
  One
  thing I'd really like to be able to do is set one or more of the vector
  layers to be partially translucent.  After rummaging through this list,
 I'm
  beginning to wonder if its possible at all, since translucency in the
 guis
  seems to be handled by g.pnmcomp, but perhaps someone with more
 experience
  knows a way to do it.

 It isn't. The graphics API doesn't support an alpha component.

 Apart from anything else, it can't easily be implemented for
 PostScript output, as PostScript doesn't support translucency. Faking
 it with patterns is possible, but it starts getting complicated if you
 want more than one translucent layer.

  The only workaround I've managed to find so far is to export each layer
 as
  an individual svg, then use something like inkscape to rejoin them,
 setting
  the translucency/transparency of each layer as I do it.  Which is fine
 for a
  map with only a few layers, but gets tedious when dealing with maps with
  dozens of layers.

 SVG is XML, so it shouldn't be especially hard to automate the process
 using generic XML-processing tools.


Ohh, I hadn't thought of editing the svg/xml directly.  Thanks for the
suggestion, I'll see what I can achieve from there.

Regards,

Peter
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] translucency and svg output

2010-03-24 Thread pete davidson
On Wed, Mar 24, 2010 at 7:49 PM, pete davidson caiti...@gmail.com wrote:



 On Wed, Mar 24, 2010 at 7:42 PM, Glynn Clements 
 gl...@gclements.plus.comwrote:


 pete davidson wrote:

  I'm producing maps in svg format using the cairo driver and d.out.file.
  One
  thing I'd really like to be able to do is set one or more of the vector
  layers to be partially translucent.  After rummaging through this list,
 I'm
  beginning to wonder if its possible at all, since translucency in the
 guis
  seems to be handled by g.pnmcomp, but perhaps someone with more
 experience
  knows a way to do it.

 It isn't. The graphics API doesn't support an alpha component.

 Apart from anything else, it can't easily be implemented for
 PostScript output, as PostScript doesn't support translucency. Faking
 it with patterns is possible, but it starts getting complicated if you
 want more than one translucent layer.

  The only workaround I've managed to find so far is to export each layer
 as
  an individual svg, then use something like inkscape to rejoin them,
 setting
  the translucency/transparency of each layer as I do it.  Which is fine
 for a
  map with only a few layers, but gets tedious when dealing with maps with
  dozens of layers.

 SVG is XML, so it shouldn't be especially hard to automate the process
 using generic XML-processing tools.


 Ohh, I hadn't thought of editing the svg/xml directly.  Thanks for the
 suggestion, I'll see what I can achieve from there.


And then we discover that the 'svg' produced by cairo using the above script
is actually just a png in an svg wrapper..  At least for my particular
install of Grass.  That's frustrating.  Ahh well, back to the drawing board.

Peter
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user