how can I get the RAW uncompressed image format from a SVG map ?

(RAW is uncompressed and unprocessed image data. once I saved the SVG as bitmap it would be already a compressed format and it is almost impossible to go back to RAW format that does not have any headers at all, just pure data.)

asked 01 Mar '12, 18:23

NullPointer's gravatar image

NullPointer
1111
accept rate: 0%

edited 01 Mar '12, 19:46

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
71.3k846451113


SVG is a vector graphics format but raster data can be embedded in SVG. If you export an SVG map with Mapnik, you will usually end up with exactl that - a vector map with some embedded raster icons.

You can convert that to PDF or a high-resoultion raster with tools like rsvg, Inkscape, Batik or others. The embedded raster bitmaps will always remain low-resolution unless you create your own rendering style that either uses high-resolution raster icons or vector icons.

permanent link

answered 01 Mar '12, 18:45

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
71.3k846451113
accept rate: 24%

1

ImageMagick is also a candidate (open source, license Apache 2.0)

(01 Mar '12, 18:50) Pieren

I do not care about quality too much, but Inkscape for example cannot Save As in the RAW format. Is any of the other tools capable of this?

(01 Mar '12, 19:20) NullPointer
1

I don't see why anybody would want that. RAW files contain stuff like metadata about the camera sensor and so on, things that clearly do not exist when you make something from SVG. If you save as PNG from Inkscape then this uses a lossless compression. ImageMagick could then be used to convert PNG to a raw format, or you could try to convert SVG->RAW directly with ImageMagick. But you won't gain anything from that.

(01 Mar '12, 19:49) Frederik Ramm ♦

well if I want to process the image in a programming language I need it in RAW format. I tried this in ImageMagick and I got this message:

$ convert map.svg map.raw convert: unrecognized color 7777777' @ warning/color.c/QueryMagickColorCompliance/2603. convert: unable to open image#7777777': No such file or directory @ error/blob.c/OpenBlob/2614. convert: no decode delegate for this image format #7777777' @ error/constitute.c/ReadImage/532. convert: non-conforming drawing primitive definitionfill' @ error/draw.c/DrawImage/3146.

what does it mean?

(01 Mar '12, 21:11) NullPointer

converting from a PNG to RAW worked though without any error messages but when I loaded the RAW into my imageLoader program it shows only colored noise. I have a sample RAW image in the program folder and I can load that one without any problem, so I am confused about all these conversions and why it's not working...

(01 Mar '12, 21:12) NullPointer
3

Don't use the RAW format. Use a proper image reading library in your program, like libgd, and open the PNG file. The RAW format is not sufficiently standardized and you'll have changed your program to use a standard image format before you have found out how to exactly tune the output to have the exact same number, width, and arrangement of pixels that your other RAW file from a different source had.

(01 Mar '12, 22:11) Frederik Ramm ♦
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×39

question asked: 01 Mar '12, 18:23

question was seen: 4,771 times

last updated: 01 Mar '12, 22:11

powered by OSQA