# SVG image format

1. Oct 11, 2015

### SlowThinker

Hello.
I access the forums from iPad or Android, and it's really hard to draw images on them. The apps are less than awesome, and most online editors (including PF whiteboard) require Flash support, which is not available on mobile devices. Javascript online editors often don't work.
When they do, I draw something and try to download the image, I get things like

data:text/plain;charset=utf-8;base64,PHN2Zy...vc3ZnPg==

instead of the image, and it can't be used as URL in Upload.

So I came up with the idea that SVG images can be written in a text editor. Some online editors even allow you to draw and then copy the SVG as text. Would it be possible to
1) Add SVG as the supported image format?
2) Add to Upload button a possibility to create a new file with contents of an edit box? This is a trivial task on a computer, but mobile devices are really limited in these things.
3) Integrate SVG into the post, such as
[SVG="400,300"]
<path d="M0 0 q 150 50 300 0" stroke="black" fill="none"/>
<path d="M0 250 q 150 50 300 0" stroke="black" fill="none"/>
[/SVG]
or similar? I see there is a chance for the SVG to be malformed, so you can't just plug it into the text, but it would be nice if possible.

2. Oct 11, 2015

### Greg Bernhardt

I can investigate more, but until then, just how many people know SVG code and would use it?

3. Oct 11, 2015

### SlowThinker

If you ask me, I can only say that it's much simpler than LaTeX.
Finding a good online SVG editor seems hard, but this is not really a choice between good and bad pictures, it's between being able or unable to post pictures at all.
What are people using to draw pictures like this one? Is there some favorite scientific picture editor?

4. Oct 12, 2015

### DrGreg

I drew this with Inkscape* -- a free SVG editor! -- and exported as a PNG bitmap. With SVG support I could have uploaded the SVG file itself. Note, however, that the SVG file was 554 KB whereas the PNG was only 48 KB.

In the past not all browsers had native support for SVG, but that may have changed.

*Well, actually MATLAB drew the pink gridlines for me, and with an SVG add-on exported an SVG file that I then tweaked with Inkscape.

5. Oct 14, 2015

### robphy

6. Oct 14, 2015

### robphy

Some simple SVG files might be smaller than their png rasterizations. One feature that would be worth exploring is an interactive SVG file.

7. Oct 14, 2015

### SlowThinker

I believe that simply enabling .SVG as the extension for uploaded images wouldn't hurt anyone. SVG is not that new, pretty much all browsers support it well.
I see that adding a textbox to the upload dialog would leave some people scratching their heads; OTOH the members of this forum are probably educated enough to understand its purpose.
Clearly, implementing the [SVG] tag is a lot of work for just a few people, I can understand that.

Do the $\LaTeX$ pictures still work? I tried it but couldn't make any image.

8. Oct 14, 2015

### robphy

Nope. MathJax doesn't seem to support the picture environment.

9. Oct 14, 2015