Hot answers tagged svg
potrace I found this example on SO in a Q&A titled: How to convert a JPEG image into SVG format using ImageMagick?. One of the answers suggested potrace. $ convert input.jpg output.ppm $ potrace -s output.ppm -o svgout.svg Results ...
Autotrace You could try autotrace. Using the following command you get the following results: autotrace --output-format svg --output-file output.svg --color-count 4 imgsrc.jpg I had to take a screencapture of the resulting svg and save as png to show the output. Here is a source image jpg: Here is the resulting image:
svg is a vector based image format, so it'll scale to any size without pixelating. The downside that it takes more CPU power to render the image, so png is slightly there. Though for icon-sized images that shouldn't be very noticeable. The "biggest" problem with svg is that not all applications support it, while they do support bitmap formats such as png.
Inkscape can convert between various vector graphics formats, including SVG to PDF. Although it's normally a GUI application, it can run in batch mode without an X server available. inkscape --without-gui --export-pdf=foo.pdf foo.svg lpr foo.pdf Or if you want to print directly: inkscape --without-gui --export-pdf=/dev/stdout foo.svg | lpr Another ...
Normally, I do all my image manipulation tasks with convert from ImageMagic but I can't get it to play nice with svg files. You can, however, use inkscape itself from the command line: for i in *bmp; do inkscape -f "$i" -l "$i.svg"; done That will create files called foo.bmp.svg. To get the names right, try this: for i in *bmp; do inkscape -f "$i" -l ...
If you make that last line: renderPDF.drawToFile(drawing, "file.pdf", autoSize=0) you will get a nice blue circle on your page. The normal parameter value for autoSize is 1 which results in the PDF being the same size as the drawing. The problem is with your svg file having no size parameters. You can e.g. change the svg openining tag to: <svg ...
Based on your comments, I would suggest that there is some combination of corruption in the original svg file and possibly a bug in Inkscape. When opening the file it is able to compensate and display, but it hasn't really understood everything or corrected the mistake and saving causes this discrepancy to tun into outright corruption. Obviously this should ...
GUIs I'm familiar with geeqie (a fork of GQView). It has pretty broad support of file formats. There are actually several that carry support for SVG. Rather than list them all here I'm going to refer you to the very well maintained Wikipedia page on the subject, titled: Comparison of image viewers. This page contains several tables, one of which is the ...
You can try Mirage, which supports png, jpg, svg, xpm, gif, bmp, tiff, and others.
I got feh to work with svg by: downloading imagemagick adding --magick-timeout 1 to the command line. Not very obvious, but that's what gets it to work... feh --magick-timeout 1 ~/image1.svg image2.jpg
I found an inelegant way to do that using orion's proposal. Assuming $svg_file_name is a variable containing file path to an SVG image. First we need image width and height width=$(exiftool -ImageWidth $svg_file_name | sed "s/.*: //;s/pt//g") height=$(exiftool -ImageHeight $svg_file_name | sed "s/.*: //;s/pt//g") PlantUML produces the diagram as a single ...
Most web browsers will display SVG files. I know Firefox will, because I do it all the time.
Refer to this bug report in Inkscape: https://bugs.launchpad.net/ubuntu/+source/inkscape/+bug/499257 The problem may be bad handling of character encoding, it sounds like it. The workaround is to manually edit the file ( I use Kate, but any editor with a search functions will do) as suggested in the bug report. I simply deleted the xpacket elements, and ...
Only top voted, non community-wiki answers of a minimum length are eligible