Bugzilla – Bug 757
Enh: Reduce image size in dumped Manual
Last modified: 2018-08-20 11:45:31 UTC
The 2.0.6 Manual will be over 20 MB (unzipped) with over 16 MB of that size in images, so colour reduction of images to reduce their size is worth doing. Very few (if any) of the images in the Manual require more than 64 colours if dither is used. Those that are currently 256 colour PNG can be reduced to around 50% of their current size by reducing the number of colours to 64. Steps were written at http://wiki.audacityteam.org/w/index.php?title=Create_Local_Manual&oldid=20791#Unused.2Foptional_step to use ImageMagick to reduce colour size but the processing has to be done every time the off-line Manual is created and the steps do not necessarily work identically on all platforms. This bug is to track a better solution to the issue, such as running ImageMagick on the images already on the server, and perhaps using an upload file script that reduces image size before new images reach the server. The issue can't really be actioned if it was logged in the Manual Wiki so placed here in the "scripts" component with "mw2html" keyword.
In the past manually uploading reduced versions of the five 'worst offenders' has made a worthwhile/significant difference. My preferred solution is to address the 'steps do not necessarily work identically on all platforms' issue. We have to run mw2html every time we fetch the manual, so we could make a python script for the image reduction step and connect it with the fetching. I have changed the type of bug from 'repeatable' to 'enhancement'. We are not in the state 'identify root cause'. Extreme idea: When scripting in audacity has been improved, we could even get audacity to generate many of the screenshots. This could be called from the installer, and would (a) eliminate the need to ship many of the images at all (b) make the images custom to the platform, e.g. mac/linux/windows. It's not a good use of effort for the (say) 10Mb reduction in download size, but might possibly be worth it for other reasons. Regenerating all the screenshot images in the manual would be a good test suite for some aspects of Audacity.
Added 'Enh:' to summary line.
There is a new potentially very easy way to do this. Our wiki is now served via Cloudflare. Cloudflare offer an option, called Polish, which offers lossy compresses of images with minimal loss of image quality. If we enable that for cloudflare, we will automatically be fetching smaller images when we pull the manual. So that would be a zero programming solution.
Buanzo enabled CloudFlare polish in lossless mode. Prior to zipping: 2.1.3 manual without 'polish' we had 719 image files and 18.1Mb 2.2.0 alpha with 'polish' enabled we have 828 image files and 11.2Mb The additional 100 or so image files are mostly from extra menus. We also have new images for new features such as themes and stem plots. Polish seems to be reducing image size by about 53% relative to the unprocessed .png format. We could get a further reduction by enabling lossy mode, probably with no visible deterioration. RESOLVED FIXED