Why when importing SVG file from inkscape to blender it's not importing anything? - svg

In inkscape I saved the file as plain svg or as inkscape svg format. The file size on hard disk is about 1.59 MB
Then in blender I opened the add-ons window and searched for svg and check the first addon I also tried to check the second one but it didn't work in any case.
Then I did in blender: File > Import > Scalable Vector Graphic (.svg)
And selected the file and clicked on import SVG:
Then it's thinking for some seconds and then it's staying in the opening window showing the cube. Tt didn't load the file:
In the Inkscape I loaded/opened this jpg file:
Then selected it and then in the Inkscape I did:
Path > Trace Bitmap...
Then clicked on Update and then on OK
Then saved it as SVG and then tried to import it in blender.
The main goal is to use inkscape and blender and to convert the image to 3d object.

Related

Is it possible to make Inkscape autotrace PNG to SVG, but from the command line?

I want to automate "raster to vector" conversions. PNG to SVG. (most Qs here on SO are the other way around)
I have tried the old command line tool autotrace on Linux, but I could not get it to run. I've tried to install a package, and to compile it from the source. Nope.
Then I've realised that Inkscape has "autotrace" now integrated in its codebase. I'd like to convert simple sketches from PNG to SVG.
And I want to do this in a Bash for-loop , with different autotrace settings (number of passes; ignore Speckles with max X pixels width) etc.
I've tried the "action" command-line option
inkscape --without-gui --actions="file-open:my.png"
and this brings up the small "png bitmap image import" dialog, waiting for me to confirm.
Also I've tried the verb command line option
inkscape --with-gui --verb="FileImport:my.png"
and this opens the large "Select file to import" dialog (ignoring my --verb argument)
At this point I gave up.
I want Inkscape to import a PNG picture, autotrace it with some settings, save it as SVG. Perhaps, beofre saving, duplicate the traced layer, lock the imported background layer, rename the layers from path-12345 to "tracesettings-x-y-z" etc.
(my final goal is to permute the tracing settings, to find good ones for my use-case, but that's not the focus of this question)
Inkscape is using potrace and autotrace to trace bitmap images into vector formats such as SVG and PDF.
Let's assume you have an image: foo.png that you want to trace to SVG using potrace:
First, you need to convert your image to a bitmap format (BMP).
Invoke the potrace command
# I am using ImageMagick convert command to convert PNG to BMP
convert foo.png foo.bmp
# Invoke potrace command with SVG backend
potrace -b svg foo.bmp
The result will be: foo.svg.

Opening an EPS file in Inkscape causes weird line artifacts

I'm trying to edit a vector graphics file from Freepik. The format is EPS and after installing both Inkscape and Ghostscript on Windows, I'm able to open the file with Inkscape. However, Inkscape introduces some weird artifacts (see lines and wrong colors in the picture below).
Side by side comparison, original vector (left) and SVG saved after opening the EPS file in Inkscape (right)
Is there a way to fix this issue?
It's a little difficult to tell, partly because this is a complex illustration and partly because the rendering is a little small. I'd suggest that the circular artefacts are caused by radial fills not being rendered completely.
This could simply be a rendering problem with Inkscape, or it could be that the radial fill has an Extend parameter which isn't being honoured. It could also be a problem calculating a clip.
It's not entirely obvious what you used to render the left hand image, is that Ghostscript ?
Generally I'd say this looks like an Inkscape bug and you should report it as such.
Edit
Reading through the Inkscape FAQ it seems that Inkscape uses SVG as its native format. That's going to mean that an awful lot of PostScript (and PDF) vector objects aren't going to be represented well. Shadings will either have to be rendered to an image or converted into a complex series of SVG primitives.
Following the link on 'How to open EPS files in Windows' from the FAQ suggests to me that EPS files are either rendered to an image or converted to PDF.
You could use Ghostscript to convert the EPS to PDF yourself, and then try loading the PDF into Inkscape to see if you get a better result. You can also open the PDF in, say, Acrobat to see if it looks OK there.
If the PDF looks fine in Acrobat, but not so good in Inkscape, then I'd say that's an Inkscape problem. If the PDF looks poor in Acrobat then that's a Ghostscript problem.
You can then report the problem as a bug to the appropriate site.
It seems that EPS has more capabilities than SVG and that's why some stuff looks weird when converted to PDF/SVG. Specifically, highlights in an EPS file are not properly rendered in an SVG file.
I checked the conversion from EPS to PDF via Ghostscript and the lines are already there, i.e. it's not an Inkscape bug.
Here's the original file to reproduce the problem:
https://www.freepik.com/free-vector/data-processing-factory-isometric-technology_8625296.htm
And here's what it looks like after converting it to PDF: The artifacts are not as noticeable on the PDF file, possibly because Ghostscript converts it with a higher DPI by default
My workaround to be able to edit the file (remove the background) was to:
open the EPS with Inkscape, ungroup the items
delete the background
export it as PNG
then use the PNG as a "mask" on GIMP to edit the JPG file that came together with the EPS.

How to rasterize svg to png without aliasing effect with "data:image/svg+xml" with Inkscape?

I have a problem while export svg to png with svg which includes some element image objects using Inkscape.
Example:
<image xlink:href="data:image/svg+xml;base64,PD94bWwgdm....Zz4=" x="-312" y="-139" width="624" height="278"></image>
Notes:
- When I open svg in web browsers, when zoom in browser images are nice, and not have aliasing effect.
- But using Inkscape command : /Applications/Inkscape.app/Contents/Resources/bin/inkscape /test/test.svg -e /test/test.png -d 300 --> image is aliasing.
Here is result on browser and output png file:
Here is my files:
1. https://drive.google.com/open?id=1Wjt-QnX4iPL3QYHfYLI7wVfq26yBCe3e --> svg file which include with svg data "data:image/svg+xml"
2. Exported png using inkscape with dpi 300
https://drive.google.com/open?id=1k171_ARwnw0-5iyM7vwJsH_h6tFWpb1v
Please help me!
Thank you!
Use a raster file that uses the correct export dpi
Scale it to the correct size in Inkscape
Position it at a full pixel value
(untested, but should work)
In (future) Inkscape 1.0, you can also uncheck the antialiasing functionality in the export dialog, but not sure how that affects raster images. It might not look good.

Image is lost items when export from *.ai file to *.svg file in Adobe Illustrator

I have a problem when export from *.ai file to *.svg file. When I used web browser to view *.svg file, image is not correct ( Leaf vein is lost ). See image below:
Environment:
OS: Windows 10, Mac OS 10.14.2
Illustrator: Adobe Illustrator CC 2019
Original AI file: lost_item_test.ai
Exported SVG file: lost_item_test.svg
Select File -> Save as ... --> choose SVG ( svg ) --> click button "save"
SVG options dialog choose option like attach image.
click "OK" to save to SVG file
Expected:
Display in SVG is the same with AI editor
Actual:
+ SVG is lost or invisible some objects ( Leaf vein is lost )
Here is my export Option:
Please help me resolve this problem.
Thank you
I played a bit around with the code and noticed that there is a styles section in the svg. when i start deleting some of the styles in there the veins start showing up again. i think there are some styles that the browsers dont seem to support?
i'd recommend looking into those styles and maybe the colors.
there is also a series on https://css-tricks.com/lodge/svg/ i'd scroll around to see if there is one that you perhaps could use!

Converting PNG file into SVG format in Corel Draw x7

What is the correct sequence of actions to convert PNG file in SVG format in Corel Draw? I import the image into a new file, then export it (selected only) into SVG format. But as a result I get very low-quality image, much worse than PNG.
The lower quality is due to the fact that your image has been embedded in the SVG, and the image is no a vector.
Steps:
Import PNG Image
Trace Bitmap (From Bitmap Menu)
Export to SVG
That's simple.
select Import in file (ctrl+I)
2.select png and select Export in File (ctrl+E)
3.select SVG in save as type DropDown
4.Select the options as shown below

Resources