That's a good point you raise about throwing out zeros first because they are not significant digits.
It would be interesting to see a script that compressed the image by removing extra digits as Henning suggested, but also allowed you to determine how much loss you were willing to accept. With the range of compression options such as:
- lossless where it only throws out zeros eg. .75000000 >> .75, 143.23123576 >> 143.23123576
- lots of loss rounds all coordinates to nearest whole number, all opacity values to
two decimal digits (so the percentage is a whole number) eg. .75000000 >> .75, 143.23123576 >> 143
- somewhere in between allows a user to specify how many digits to round off eg. .750 >> .75, 143.23123576 >> 143.231
I'm sure it would be possible to further optimize the compression by doing things like changing path names to shorter values, remove whitespace, convert styles to a style sheet, etc.
- Dave
-----Original Message----- From: inkscape-user-admin@lists.sourceforge.net [mailto:inkscape-user-admin@lists.sourceforge.net] On Behalf Of mental@...32... Sent: Thursday, November 17, 2005 8:51 AM To: inkscape-user@lists.sourceforge.net Subject: Re: [Inkscape-user] Cut off digits after decimal point automatically?
Quoting Henning Pingel <henning.pingel@...26...>:
It should work like this:
Before:
<path d="M 197.50906,180.93358 C 208.42611,171.19005
243.09749,175.25444 255.13174,160.93358 C 258.56906,156.84315 258.33300,147.20836 258.33300,140.93358"
style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#00000 0;stroke-width:1.0585089px;stroke-linecap:butt;stroke-linejoin:miter;str oke-opacity:1.0000000"
id="path1310" />
After:
<path d="M 197,180 C 208,171 243,175 255,160 C 258,156 258,147
258,140"
style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#00000 0;stroke-width:1.0585089px;stroke-linecap:butt;stroke-linejoin:miter;str oke-opacity:1.0000000"
id="path1310" />
Thanks in advance!
It seems like the numbers like 0.75000000 would be better candidates for throwing out digits (as those zeroes are not significant).
For paths, throwing out the fractional part of all coordinates is likely to cause visible distortions.
-mental
------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_idv28&alloc_id%16845&op=ick _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user