Moodle

PNG and JPEG images are not optimized

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Performance
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Running optipng and jpegoptim (lossless optimization of images) on all of the images in HEAD could give us some significant savings in terms of file sizes.

I have attached logs for running both of these tools on the Moodle repo:

find -name "*.png" | xargs -n 10 -P 2 optipng -o7 > optipng.log
find -name "*.jpg" | xargs -n 1 -P 2 jpegoptim --strip-all > jpegoptim.log

Some highlights:

./theme/cornflower/images/hdbg.jpg 41x112 24bit Adobe [OK] 13047 --> 506 bytes (96.12%), optimized.
./theme/cornflower/images/classroomrevolution.jpg 165x25 24bit Adobe [OK] 21437 --> 6826 bytes (68.16%), optimized.
./theme/cornflower/images/hdbgend.jpg 41x112 24bit Adobe [OK] 13047 --> 506 bytes (96.12%), optimized.
Output file size = 2400 bytes (30602 bytes = 92.73% decrease)
Output file size = 2400 bytes (30602 bytes = 92.73% decrease)
Output file size = 5700 bytes (44367 bytes = 88.62% decrease)
Output file size = 5700 bytes (44367 bytes = 88.62% decrease)
Output file size = 8318 bytes (138486 bytes = 94.33% decrease)
Output file size = 8047 bytes (136486 bytes = 94.43% decrease)
Output file size = 2850 bytes (55938 bytes = 95.15% decrease)
Output file size = 955 bytes (69153 bytes = 98.64% decrease)
Output file size = 809 bytes (28663 bytes = 97.26% decrease)
Output file size = 924 bytes (69325 bytes = 98.68% decrease)
Output file size = 2289 bytes (52590 bytes = 95.83% decrease)

Here is another tool (firefox extension) that can be used:
http://developer.yahoo.net/blog/archives/2008/09/smushitcom_opti.html

  1. jpegoptim.log
    28/Oct/08 10:33 AM
    4 kB
    Francois Marier
  2. optipng.log
    28/Oct/08 10:33 AM
    1.58 MB
    Francois Marier

Activity

Hide
Martin Dougiamas added a comment -

+1 from me! Sounds great for HEAD! Thanks!

Show
Martin Dougiamas added a comment - +1 from me! Sounds great for HEAD! Thanks!
Hide
Francois Marier added a comment -

We can also use gifsicle to optimise GIF files:

find . -iname '*.gif' -exec gifsicle -O2 -b {} \;

( All of these tools are suggested here: http://docs.moodle.org/en/Performance#Moodle_Image_Optimization )

Show
Francois Marier added a comment - We can also use gifsicle to optimise GIF files: find . -iname '*.gif' -exec gifsicle -O2 -b {} \; ( All of these tools are suggested here: http://docs.moodle.org/en/Performance#Moodle_Image_Optimization )
Hide
Francois Marier added a comment -

Committed optimised GIFs and PNGs to HEAD.

Show
Francois Marier added a comment - Committed optimised GIFs and PNGs to HEAD.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: