Wall pattern disappears in SVG when embedded in website

This topic has been viewed 3001 times and has 13 replies
Thread status: Active
How can I do this? [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
flip3
Posts: 10
Joined: Mon May 06, 2024 1:38 am
Country: Switzerland

Re: Wall pattern disappears in SVG when embedded in website

Post by flip3 »

What I can tell you is that the svg file on your lagerraum web page does not contain the necessary embedded image data (base64 encoded) for the hatching pattern. When you export from SH3D it encodes the pattern as a single large encoded image. This is missing in the server delivered file.
Now, I got it. This pattern is actually not a vector graphic but a rasterized image which blows up the file size. When I enlarge my vector file, the pattern becomes blurry. Well, that's of course not so good. Therefore, you cannot compress the SVG file itself but I would need to save the file as PNG as you suggested.
sjb007
Posts: 300
Joined: Tue May 18, 2021 1:49 pm

Re: Wall pattern disappears in SVG when embedded in website

Post by sjb007 »

An alternative is to open your SVG file in Inkscape. Select the hashing image object(s) and delete it. Now select the wall outline, and use the Inkscape "pattern" fill feature on the actual wall outline. The outline and the fill are separate objects which makes this possible. You can select a pattern, rotate it and scale it, and I managed to get something pretty close to the hashing you used using one of the builtin options by doing this.

The Inkscape patterns are purely vector based, and will give you small file sizes.
User avatar
Daniels118
Posts: 503
Joined: Wed Nov 17, 2021 9:04 pm
Country: Italy

Re: Wall pattern disappears in SVG when embedded in website

Post by Daniels118 »

Have you tried the SVG tuner plugin? It will compress the embedded images to get a smaller svg file. Compression is lossless, so won't be any blurred image.
flip3
Posts: 10
Joined: Mon May 06, 2024 1:38 am
Country: Switzerland

Re: Wall pattern disappears in SVG when embedded in website

Post by flip3 »

@sjb007: I think that this is a good and easy solution since I need also other edits such as changing the font colors. I will try this since my CMS strips out base64-encoded images from the SVG.
@Daniels118: I installed the plugin and it changes the file size a lot. In my case the file size of the SVG went down from more than 1 MB to about 50KB ;-)

Thanks a lot for your suggestions.
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest