Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 22
Posts: 22   Pages: 3   [ 1 2 3 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 6762 times and has 21 replies Next Thread
Gildaniel
Advanced Member
Member's Avatar

Russia
Joined: Aug 11, 2017
Post Count: 135
Status: Offline
Reply to this Post  Reply with Quote 
Floor have huge size in svg (tens of Mb)

There are floor size problem of .svg files, the bigger room - the bigger file size. Slow download of huge files, using in web.

Is it possible to reduce the size somehow?

Here 4 examples:

1. Only backround room, 4Mb

https://woodmouse.ru/test/size1.svg


2. Only walls, 18Mb

https://woodmouse.ru/test/size2.svg


3. Walls and rooms, 28Mb

https://woodmouse.ru/test/size3.svg

4. Background room, walls and rooms, 49Mb

https://woodmouse.ru/test/size4.svg
[Feb 2, 2022, 8:06:09 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Daniels118
Advanced Member
Member's Avatar

Italy
Joined: Nov 17, 2021
Post Count: 407
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

Your problem is here:

I've resampled the embedded image using an svg editor and now the file is just 123 KB:
https://daniels118.altervista.org/temp/size1b.svg

The black fill is actually a high resolution image. Where it comes from?
[Feb 3, 2022, 6:39:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Gildaniel
Advanced Member
Member's Avatar

Russia
Joined: Aug 11, 2017
Post Count: 135
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

> Where it comes from?

Hello! This is just normal sweethome walls drawn and exported to svg.

If they can be resampled, probably it's could be done within the export, not to use other tools?
[Feb 11, 2022, 1:49:45 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Daniels118
Advanced Member
Member's Avatar

Italy
Joined: Nov 17, 2021
Post Count: 407
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

What follow is non a solution, just some considerations useful for further analysis.

It seems SH3D encodes the pattern for all the walls in a single PNG image when exporting to the SVG format (the PNG is embedded into the SVG). This means even if you have just 2 small walls, the farther they are, the larger the image will be. Now this shouldn't be a great problem, because PNG supports compression and the blank space between walls is prone to give high compression ratios.

The problem is the PNG image is produced without compression biggrin

In fact, I have achieved small file size even without resampling the PNG, just running an optimizer.

I will take a look to the code responsible for the exporting, but maybe Puybaret already know where and how to fix the issue.
[Feb 12, 2022, 12:31:11 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Gildaniel
Advanced Member
Member's Avatar

Russia
Joined: Aug 11, 2017
Post Count: 135
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

[quote

I will take a look to the code responsible for the exporting, but maybe Puybaret already know where and how to fix the issue.

Oh, thank you!

I didn’t even think that the matter was in the walls, it always seemed to me that the larger the "garden" room, the larger the size of the picture.

Usually I export first floor with garden (to show home positioning), and first floor without garden, and second picture almost two times smaller.

Like here https://woodmouse.ru/3dplan/un/5.html
[Feb 12, 2022, 1:47:34 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Daniels118
Advanced Member
Member's Avatar

Italy
Joined: Nov 17, 2021
Post Count: 407
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

Hello Gildaniel, I've built a plugin which solves the problem!
You can download it from the sourceforge page.
[Feb 12, 2022, 8:35:58 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Gildaniel
Advanced Member
Member's Avatar

Russia
Joined: Aug 11, 2017
Post Count: 135
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

Ooh, Daniel, It works, so good!!!

Now SVG weight is 1,5Mb instead of 49Mb before!
I am so grateful to you!
[Feb 13, 2022, 3:12:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
sjb007
Advanced Member




Joined: May 18, 2021
Post Count: 219
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

Not sure why, Daniel, but it seems I'm your nemesis wink

I have an architects floorplan as a background image in a big SH3D file I've been working on. It seems that your SVG Tuner really doesn't like that image. It just never finishes exporting after many minutes. It works in a few seconds without the plugin. If I disable the background containing layer, it works OK with your plugin, so it seems specifically linked to that background image. Last symptom is if I cancel a stalled export, then try a second export, nothing happens after selecting the file name. It would suggest something went badly wrong, and the function is no longer callable somehow.

Nothing in the logs from your autologger plugin.

Amazing job of pumping out these plugins by the way.
[Feb 14, 2022, 2:37:15 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Daniels118
Advanced Member
Member's Avatar

Italy
Joined: Nov 17, 2021
Post Count: 407
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

Not sure why, Daniel, but it seems I'm your nemesis

AHAHAH laughing
Please check the cpu usage using the task manager while exporting to svg.
I suspect that compressing that image could be too heavy for the compression algorithm.
I was expecting there might be problems, so I figured out a way to change the default settings without rebuilding the plugin. You could try to decrease the compression level by starting sh3d with a java property named png.compression,it accepts integer values in range 0-9 (the default is 9).
[Feb 14, 2022, 6:57:43 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
sjb007
Advanced Member




Joined: May 18, 2021
Post Count: 219
Status: Offline
Reply to this Post  Reply with Quote 
Re: Floor have huge size in svg (tens of Mb)

I used:
.\SweetHome3D.exe -Dpng.compression=0

Which should be no compression as I understand it. Anyway, same issue. The export never completes, the same as without the parameter, and the process cpu usage sticks at betweeen 16 and 20%. (I have a 4C/8T mobile i7.) The svg file is created, but 0 KB still after >10 minutes. I'll leave it running a while, but I think it is borked still.
[Feb 14, 2022, 9:19:14 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 22   Pages: 3   [ 1 2 3 | Next Page ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved