dstndstn / astrometry.net

Astrometry.net -- automatic recognition of astronomical images
http://astrometry.net
Other
650 stars 184 forks source link

Allow plot-constellations to output SVG #82

Open ntim opened 8 years ago

ntim commented 8 years ago

Hi,

the Cairo library supports SVG out of the box, so I had the idea to let the plot-constellations program optionally output SVG instead of PNG which would allow user manipulation after drawing and nicer drawing of the names and circles regardless the size of the original image. Furthermore, the original image could be extracted from the SVG file.

Have you already tried to implement this feature? Are there any show-stoppers?

Best

dstndstn commented 7 years ago

(Not sure why I didn't get notified of this issue... Apparently I don't look here very often!)

I just had a look and I'm not sure it's totally trivial. In plot-constellations, we create an in-memory Cairo image surface, and then at the end we pull that image from memory and write as PNG, PPM, or JPEG using our own wrappings of the PNG/JPEG library; to write to SVG you need to create a Cairo SVG surface instead. Maybe that would work fine, but in plot-constellations we also create multiple image layers (to properly plot labels over lines, eg) and layer them in. Not sure if that works with SVG surfaces.

You're welcome to try... :)