Re: [sage-release] A detail that matters - please help

2023-06-28 Thread Marc Culler
No, that is not correct.  The fundamental issue is the size of the 
compressed file.  And this is an issue with documentation, not with 
arbitrary graphics.  The matplotlib images in the Sage documentation do not 
involve millions of lines of svg code.  The svg files are small to start 
with and compress very efficiently.  Of course it would be possible to 
generate images which are naturally rasterized and would be very 
inefficiently represented by svg.  But that is not happening with the 
matplotlib images in the documentation.

- Marc

On Wednesday, June 28, 2023 at 11:31:01 AM UTC-5 Harald Schilly wrote:

> On Wed, Jun 28, 2023 at 6:17 PM Dima Pasechnik  wrote:
>
>> are there any setbacks in using svg nowadays?
>>
>>
> The only fundamental issue is file size. It's proportional to the number 
> of elements you want to plot. So, e.g. when there are a million points, you 
> end up with a million lines of text in the svg – while with a raster image 
> format like png, the points are "fused" to a large blob and file size stays 
> constant or even decreases. My guess is, all those plots in the 
> documentation have only a small number of elements, so, all fine :-)
>
> -- Harald
>
>
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-release/8b2cf8aa-ef71-4d35-802b-882adaf1db36n%40googlegroups.com.


Re: [sage-release] A detail that matters - please help

2023-06-28 Thread Harald Schilly
On Wed, Jun 28, 2023 at 6:17 PM Dima Pasechnik  wrote:

> are there any setbacks in using svg nowadays?
>
>
The only fundamental issue is file size. It's proportional to the number of
elements you want to plot. So, e.g. when there are a million points, you
end up with a million lines of text in the svg – while with a raster image
format like png, the points are "fused" to a large blob and file size stays
constant or even decreases. My guess is, all those plots in the
documentation have only a small number of elements, so, all fine :-)

-- Harald

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-release/CAGG4CB43qHAaz2NmA91K%3DKLMZ5rXmSkqsi3Aa1_qage4-kGgEQ%40mail.gmail.com.


Re: [sage-release] A detail that matters - please help

2023-06-28 Thread Dima Pasechnik
On Wed, 28 Jun 2023, 17:13 John H Palmieri,  wrote:

> I think this should be discussed at sage-devel.
>

are there any setbacks in using svg nowadays?


> On Wednesday, June 28, 2023 at 8:49:51 AM UTC-7 vdelecroix wrote:
>
>> I agree with Marc that svg is almost always preferable than png for
>> graphics : it scales and compresses. Thanks for raising the issue.
>>
>> Do you have a concrete proposal for making the change png -> svg
>> happen? I guess there is a lot of files that would be involved in the
>> transition.
>>
>> Vincent
>>
>> On Wed, 28 Jun 2023 at 16:23, Marc Culler  wrote:
>> >
>> > Details really do matter. The devil is in them. Here is one which makes
>> a major difference to my efforts to distribute Sage. I hope that I can
>> convince people to pay attention to it.
>> >
>> > DETAIL: An svg image can be compressed very efficiently and will look
>> good at all resolutions. A png image can not be compressed, being already
>> compressed, and pixelates at high resolutions.
>> >
>> > BACK STORY: I am working on adding documentation to the Sage_macOS
>> distribution. Size is important. For 10.1beta3 the English documentation
>> occupied 631MB, and compressed down to 104MB. For 10.1beta4 the
>> uncompressed size increased by over 100MB due to the addition of 100MB of
>> png images. Now it only compresses to 207MB, doubling the compressed size.
>> >
>> > There is no need for this wastefulness. Here is an example:
>> >
>> > sage: D = graphs.DodecahedralGraph()
>> > sage: p = D.plot()
>> > sage: p.save_image('/tmp/dodec.svg')
>> > sage: p.save_image('/tmp/dodec.png')
>> >
>> > The result:
>> > % ls -l /tmp/dodec*
>> > -rw-r--r--@ 1 culler wheel 42735 Jun 28 08:48 /tmp/dodec.png
>> > -rw-r--r-- 1 culler wheel 18524 Jun 28 08:48 /tmp/dodec.svg
>> > % gzip /tmp/dodec*
>> > % ls -l /tmp/dodec*
>> > -rw-r--r--@ 1 culler wheel 39473 Jun 28 08:48 /tmp/dodec.png.gz
>> > -rw-r--r-- 1 culler wheel 3815 Jun 28 08:48 /tmp/dodec.svg.gz
>> >
>> > BOTTOM LINE: we get more than a 90% reduction in size simply by
>> choosing to use the .svg extension when saving the plot instead of the .png
>> extension.
>> >
>> > I am not allowed to upload an svg file to google groups, so you will
>> have to verify for yourself that the svg looks better than the png, but it
>> does.
>> >
>> > - Marc
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "sage-release" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to sage-release...@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sage-release/8ce7a804-3be1-4551-959e-cc770fe589ecn%40googlegroups.com.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-release" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-release+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-release/70d5389f-97ae-490e-b57f-3838a737114an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-release/CAAWYfq1zhUVsk0UR1uJv6snYaNOX4DGt96N6Qt23v5oMdVVOZA%40mail.gmail.com.


Re: [sage-release] A detail that matters - please help

2023-06-28 Thread Marc Culler
As far as I can tell it is a choice that is being made at various places in 
the sage_docbuild module to use png as the default image format.  But I 
haven't been able to find exactly where.  One place appears to be line 117 
in src/sage_docbuild/conf.py, but that is not the only place.

- Marc

On Wednesday, June 28, 2023 at 10:49:51 AM UTC-5 Vincent Delecroix wrote:

> I agree with Marc that svg is almost always preferable than png for
> graphics : it scales and compresses. Thanks for raising the issue.
>
> Do you have a concrete proposal for making the change png -> svg
> happen? I guess there is a lot of files that would be involved in the
> transition.
>
> Vincent
>
> On Wed, 28 Jun 2023 at 16:23, Marc Culler  wrote:
> >
> > Details really do matter. The devil is in them. Here is one which makes 
> a major difference to my efforts to distribute Sage. I hope that I can 
> convince people to pay attention to it.
> >
> > DETAIL: An svg image can be compressed very efficiently and will look 
> good at all resolutions. A png image can not be compressed, being already 
> compressed, and pixelates at high resolutions.
> >
> > BACK STORY: I am working on adding documentation to the Sage_macOS 
> distribution. Size is important. For 10.1beta3 the English documentation 
> occupied 631MB, and compressed down to 104MB. For 10.1beta4 the 
> uncompressed size increased by over 100MB due to the addition of 100MB of 
> png images. Now it only compresses to 207MB, doubling the compressed size.
> >
> > There is no need for this wastefulness. Here is an example:
> >
> > sage: D = graphs.DodecahedralGraph()
> > sage: p = D.plot()
> > sage: p.save_image('/tmp/dodec.svg')
> > sage: p.save_image('/tmp/dodec.png')
> >
> > The result:
> > % ls -l /tmp/dodec*
> > -rw-r--r--@ 1 culler wheel 42735 Jun 28 08:48 /tmp/dodec.png
> > -rw-r--r-- 1 culler wheel 18524 Jun 28 08:48 /tmp/dodec.svg
> > % gzip /tmp/dodec*
> > % ls -l /tmp/dodec*
> > -rw-r--r--@ 1 culler wheel 39473 Jun 28 08:48 /tmp/dodec.png.gz
> > -rw-r--r-- 1 culler wheel 3815 Jun 28 08:48 /tmp/dodec.svg.gz
> >
> > BOTTOM LINE: we get more than a 90% reduction in size simply by choosing 
> to use the .svg extension when saving the plot instead of the .png 
> extension.
> >
> > I am not allowed to upload an svg file to google groups, so you will 
> have to verify for yourself that the svg looks better than the png, but it 
> does.
> >
> > - Marc
> >
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "sage-release" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-release...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-release/8ce7a804-3be1-4551-959e-cc770fe589ecn%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-release/eec708c2-0c16-467d-96d3-e50741b6a2adn%40googlegroups.com.


Re: [sage-release] A detail that matters - please help

2023-06-28 Thread John H Palmieri
I think this should be discussed at sage-devel.

On Wednesday, June 28, 2023 at 8:49:51 AM UTC-7 vdelecroix wrote:

> I agree with Marc that svg is almost always preferable than png for
> graphics : it scales and compresses. Thanks for raising the issue.
>
> Do you have a concrete proposal for making the change png -> svg
> happen? I guess there is a lot of files that would be involved in the
> transition.
>
> Vincent
>
> On Wed, 28 Jun 2023 at 16:23, Marc Culler  wrote:
> >
> > Details really do matter. The devil is in them. Here is one which makes 
> a major difference to my efforts to distribute Sage. I hope that I can 
> convince people to pay attention to it.
> >
> > DETAIL: An svg image can be compressed very efficiently and will look 
> good at all resolutions. A png image can not be compressed, being already 
> compressed, and pixelates at high resolutions.
> >
> > BACK STORY: I am working on adding documentation to the Sage_macOS 
> distribution. Size is important. For 10.1beta3 the English documentation 
> occupied 631MB, and compressed down to 104MB. For 10.1beta4 the 
> uncompressed size increased by over 100MB due to the addition of 100MB of 
> png images. Now it only compresses to 207MB, doubling the compressed size.
> >
> > There is no need for this wastefulness. Here is an example:
> >
> > sage: D = graphs.DodecahedralGraph()
> > sage: p = D.plot()
> > sage: p.save_image('/tmp/dodec.svg')
> > sage: p.save_image('/tmp/dodec.png')
> >
> > The result:
> > % ls -l /tmp/dodec*
> > -rw-r--r--@ 1 culler wheel 42735 Jun 28 08:48 /tmp/dodec.png
> > -rw-r--r-- 1 culler wheel 18524 Jun 28 08:48 /tmp/dodec.svg
> > % gzip /tmp/dodec*
> > % ls -l /tmp/dodec*
> > -rw-r--r--@ 1 culler wheel 39473 Jun 28 08:48 /tmp/dodec.png.gz
> > -rw-r--r-- 1 culler wheel 3815 Jun 28 08:48 /tmp/dodec.svg.gz
> >
> > BOTTOM LINE: we get more than a 90% reduction in size simply by choosing 
> to use the .svg extension when saving the plot instead of the .png 
> extension.
> >
> > I am not allowed to upload an svg file to google groups, so you will 
> have to verify for yourself that the svg looks better than the png, but it 
> does.
> >
> > - Marc
> >
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "sage-release" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-release...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-release/8ce7a804-3be1-4551-959e-cc770fe589ecn%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-release/70d5389f-97ae-490e-b57f-3838a737114an%40googlegroups.com.


Re: [sage-release] A detail that matters - please help

2023-06-28 Thread Vincent Delecroix
I agree with Marc that svg is almost always preferable than png for
graphics : it scales and compresses. Thanks for raising the issue.

Do you have a concrete proposal for making the change png -> svg
happen? I guess there is a lot of files that would be involved in the
transition.

Vincent

On Wed, 28 Jun 2023 at 16:23, Marc Culler  wrote:
>
> Details really do matter.  The devil is in them.  Here is one which makes a 
> major difference to my efforts to distribute Sage.  I hope that I can 
> convince people to pay attention to it.
>
> DETAIL: An svg image can be compressed very efficiently and will look good at 
> all resolutions.  A png image can not be compressed, being already 
> compressed, and pixelates at high resolutions.
>
> BACK STORY: I am working on adding documentation to the Sage_macOS 
> distribution.  Size is important.  For 10.1beta3 the English documentation 
> occupied 631MB, and compressed down to 104MB.  For 10.1beta4 the uncompressed 
> size increased by over 100MB due to the addition of 100MB of png images.  Now 
> it only compresses to 207MB, doubling the compressed size.
>
> There is no need for this wastefulness.  Here is an example:
>
> sage: D = graphs.DodecahedralGraph()
> sage: p = D.plot()
> sage: p.save_image('/tmp/dodec.svg')
> sage: p.save_image('/tmp/dodec.png')
>
> The result:
> % ls -l /tmp/dodec*
> -rw-r--r--@ 1 culler  wheel  42735 Jun 28 08:48 /tmp/dodec.png
> -rw-r--r--  1 culler  wheel  18524 Jun 28 08:48 /tmp/dodec.svg
> % gzip /tmp/dodec*
> % ls -l /tmp/dodec*
> -rw-r--r--@ 1 culler  wheel  39473 Jun 28 08:48 /tmp/dodec.png.gz
> -rw-r--r--  1 culler  wheel   3815 Jun 28 08:48 /tmp/dodec.svg.gz
>
> BOTTOM LINE: we get more than a 90% reduction in size simply by choosing to 
> use the .svg extension when saving the plot instead of the .png extension.
>
> I am not allowed to upload an svg file to google groups, so you will have to 
> verify for yourself that the svg looks better than the png, but it does.
>
> - Marc
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-release" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-release+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-release/8ce7a804-3be1-4551-959e-cc770fe589ecn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-release/CAGEwAA%3D0xpYCdwGhhrOhuT20MfMUFDzYODYx4MpCA-_oeU_%2BDQ%40mail.gmail.com.


[sage-release] A detail that matters - please help

2023-06-28 Thread Marc Culler
Details really do matter.  The devil is in them.  Here is one which makes a 
major difference to my efforts to distribute Sage.  I hope that I can 
convince people to pay attention to it.

DETAIL: An svg image can be compressed very efficiently and will look good 
at all resolutions.  A png image can not be compressed, being already 
compressed, and pixelates at high resolutions.

BACK STORY: I am working on adding documentation to the Sage_macOS 
distribution.  Size is important.  For 10.1beta3 the English documentation 
occupied 631MB, and compressed down to 104MB.  For 10.1beta4 the 
uncompressed size increased by over 100MB due to the addition of 100MB of 
png images.  Now it only compresses to 207MB, doubling the compressed size.

There is no need for this wastefulness.  Here is an example:

sage: D = graphs.DodecahedralGraph()
sage: p = D.plot()
sage: p.save_image('/tmp/dodec.svg')
sage: p.save_image('/tmp/dodec.png')

The result:
% ls -l /tmp/dodec*
-rw-r--r--@ 1 culler  wheel  42735 Jun 28 08:48 /tmp/dodec.png
-rw-r--r--  1 culler  wheel  18524 Jun 28 08:48 /tmp/dodec.svg
% gzip /tmp/dodec*
% ls -l /tmp/dodec*
-rw-r--r--@ 1 culler  wheel  39473 Jun 28 08:48 /tmp/dodec.png.gz
-rw-r--r--  1 culler  wheel   3815 Jun 28 08:48 /tmp/dodec.svg.gz

BOTTOM LINE: we get more than a 90% reduction in size simply by choosing to 
use the .svg extension when saving the plot instead of the .png extension.

I am not allowed to upload an svg file to google groups, so you will have 
to verify for yourself that the svg looks better than the png, but it does.

- Marc


-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-release/8ce7a804-3be1-4551-959e-cc770fe589ecn%40googlegroups.com.