CODEgrunt blog

Commentary and insight on web development and the Internet at large written with a wry smile and a hungry look.

image quality versus page load speed - Thu Aug 06, 2009

So what is the answer to following question?

100 - 25 = ???

Well, if we are talking JPG quality levels and PHP's GD based image resizing functions then the answer is an approximate 10 times reduction in file size!

A customer was recently commenting on slow page loading for site of theirs. Taking a closer look I noticed that the image resize class being used was defaulting to 100 for the quality argument for PHP's imagejpeg() function. Adjusting this down to 75 plus adding in a bit more on the fly thumbnail creation for larger images took their index page from a startling 7MB down to around 600KB (still high but this is an image heavy site)

These things are easy to miss when you are developing on a local desktop or LAN hosted server. A quick peek at the "View Page Information" menu provided by the excellent Firefox Web Developer plugin is a great way to check whether you are going well over your bandwidth budget for your current project.

blog

CODEgrunt consulting

Experienced PHP web developer.

$35 an hour, no job too small.

There is no replacement for integrity and experience.

Contact me for more information.

calendar

May 2012

Sun
Mon
Tue
Wed
Thu
Fri
Sat
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2