10 Updates
Image Performance

Image Performance

Jan 22 2014, 5:47am CST | by

By Lara Swanson Images make up the majority of most sites’ page weight . Thanks to their size and the number of image requests made by an average site, optimizing images is arguably the...

Filed under: news

 
 
 

26 weeks ago

Image Performance

Jan 22 2014, 5:47am CST | by

By Lara Swanson

Images make up the majority of most sites’ page weight . Thanks to their size and the number of image requests made by an average site, optimizing images is arguably the easiest big win when it comes to improving your site’s page load time.

Let’s start by looking at the various image types available, and then work through the various options you have for optimizing them.

Image File Types

You have a range of file types to choose from when creating images for your site. When generating an image, ask yourself:

* How compressed can this image be?
* How many colors are needed?
* Do I need transparency?/>/>

When you need transparency in your image, PNG is your best choice. GIFs also support transparency, but they tend to be much heavier than PNGs. PNG-8 contains a maximum of 256 colors within the image, and generally result in a smaller file size. If you have a small number of colors in your image, PNG-8 will likely be your best option of all image file types, thanks to its small size. While Photoshop supports exporting PNG-8 with binary transparency, it also supports creating PNG-24 images with partial transparency as well as millions of colors. This naturally results in a larger file size.

Use JPEG for photos and other images with tons of colors. JPEGs do not support transparency. JPEG is a lossy compressed file format, unlike PNGs, which are lossless. While you can use PNGs for photos, they will often be five to ten times larger in file size than JPEGs because they are lossless. Since you're aiming for the smallest file size to decrease page load time, and web images typically have more than 256 colors, it's no surprise that the majority of the images analyzed by HTTP Archive are JPEGs .

Optimizing Image Request Size

If you use Photoshop, test out a few different qualities and file types in the Save for Web workflow. You’re aiming for a happy medium of acceptable quality and small file size. Most people find that for JPEGs, 80-90% quality works well, but it’s important to play with the file size and see what level of compression is noticeable. Look for artifacts, inaccurate contrast between elements, and blurry details and text.

After you’ve exported the image, run it through a tool like ImageOptim , which finds the best compression technique for a variety of file types. There’s also SmushIt , which is an online lossless image optimizer. These tools can save you a ton of additional file size by finding ways to reduce the image size without visibly reducing the quality of the image.

Optimizing the Number of Image Requests

In addition to decreasing your images’ file sizes, it’s also important to decrease the number of image requests on the page to improve page load time. One way to do this is to combine images into sprites . Your page weight might increase slightly because you’ll have one large image file and additional CSS to position the site elements, but it’s likely that combining images into a sprite will be a huge win for page speed.

Another way to decrease image requests is to replace them with CSS3 gradients . CSS3 gradients (aka visuals):

* Can handle transparency
* Can be overlaid on a background color
* Eliminate an image request
* Are super easy to re-edit/>/>/>

CSS3 can be a great, performant replacement for images. Don’t worry about the extra page weight from the vendor-prefixes in CSS3 syntax; if you arent’ already, you should be using GZIP on your site, which will take care of optimizing this code. Even though you will be loading more CSS, it’ll still be a faster-loading option than an image request.

You can do some pretty amazing things with CSS3 gradients because of the control over where colors begin and end. That being said, be careful how your CSS affects repaint times, as there can be a cost to using a lot of CSS3. A repaint is an expensive operation performance-wise and can make your page look sluggish. If you find that your user interface does become sluggish, especially upon scrolling, you may have a CSS3 or JavaScript repaint issue and will want to diagnose what’s causing it using tools from JankFree.org .

Optimizing images is likely the biggest win for performance on your site. As you take a look at the images on your site, ask yourself:/>/>

* Can I save any file size by choosing a different image format?
* Have all of my images been run through a lossless compression tool?
* Can any of my image requests be replaced with gradients or sprites?
* Is there any UI slugishness that could be due to repaint times?/>/>/>

In the next post, we’ll cover optimizations you can make to the HTML and CSS of your site such as creating design patterns that can be repurposed, identifying the best naming patterns for your elements, and caching assets correctly.

Additional Resources

This post originally appeared on O’Reilly Programming (“Image Performance “). It’s republished with permission.

Source: Forbes Business

 
Update
10

6 weeks ago

RM47mil KWSG contributions still unclaimed

Jun 9 2014 7:54am CDT | Source: Business Times Malaysia

Cambodia's Famous Battambang Circus
KUALA LUMPUR: About RM47 million of contributions in the Teachers Provident Fund (KWSG) still remain unclaimed, the Dewan Rakyat was told ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
9

6 weeks ago

Gold shop lost almost RM1mil

Jun 9 2014 3:50am CDT | Source: Business Times Malaysia

Sydney FC v West Ham United - Football United New Zealand Tour 2014
KANGAR: A gold shop owner lost almost RM1 million after after the safe on in his shop was broken i ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
8

6 weeks ago

Motion to debate MAS losses in Dewan Rakyat rejected

Jun 9 2014 3:39am CDT | Source: Business Times Malaysia

Federal Aviation Administration Bans All US Flights To Israel
KUALA LUMPUR: AN emergency motion to debate the losses incurred by Malaysia Airlines last year, amounting to RM1.2 billion was rejected ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
7

6 weeks ago

MH370 Tragedy: Hisham: RM27.6 mil spent on 1st phase of SAR

Jun 9 2014 2:11am CDT | Source: Business Times Malaysia

KUALA LUMPUR: Malaysia spent some RM27.6 million in its first phase of the search operations for missing Malaysia Airline flight MH370, said Acting Transport Minister, Datuk Seri Hishammudd ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
6

6 weeks ago

9.1m litres of diesel seized in a month

Jun 8 2014 1:11am CDT | Source: Business Times Malaysia

INDIA-CHINA-DIPLOMACY-TRADE
PUTRAJAYA: The Domestic Trade, Cooperatives, and Consumerism ministry has seized some 9.1 million litres of diesel and property worth RM58 million since mounting ‘Operasi Diesel Selatan’ in the ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
5

7 weeks ago

Girl, 9, awarded RM2.78m compensation for medical negligence

Jun 6 2014 4:56am CDT | Source: Business Times Malaysia

Government Weekly Cabinet Meeting
KUALA LUMPUR: A nine-year-old girl who suffered brain damage during her birth at a government hospital was awarded over RM2.78 million ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
4

7 weeks ago

Malaysia's total trade in April up 12pc

Jun 5 2014 11:52pm CDT | Source: Business Times Malaysia

KUALA LUMPUR: Malaysia's total trade in April 2014 rose by 12 per cent from a year ago to RM123.86 billion due to growing trading activities, International Trade and Industry Minister D ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
3

7 weeks ago

Works Ministry to spend RM20m for upgrading works at 50 accident black spots

Jun 4 2014 11:35pm CDT | Source: Business Times Malaysia

Iskandar Johor Open - Previews
JOHOR BARU: The Works Ministry will implement upgrading works at 50 accident prone locations in the country that have been identified this year involving an allocation of ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
2

7 weeks ago

Najib launches loan scheme for Ramadan traders

Jun 4 2014 10:24pm CDT | Source: Business Times Malaysia

EurAsia Cup presented by DRB-HICOM - Day One
PUTRAJAYA: Prime Minister Datuk Seri Najib Razak today launches RM45 million Ramadan Bazaar Scheme 201 ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 
Update
1

7 weeks ago

Residents bring up objection against Kidex to Suhakam

Jun 4 2014 4:49am CDT | Source: Business Times Malaysia

PETALING JAYA: A group of 20 Petaling Jaya residents held a meeting with the Human Rights Commission of Malaysia (Suhakam) over their objection against the proposed RM2.2 billion Kinrara Damansara Skyway ...
Source: Business Times Malaysia   Full article at: Business Times Malaysia
 

 

Don't miss ...

 

<a href="/latest_stories/all/all/30" rel="author">Forbes</a>
Forbes is among the most trusted resources for the world's business and investment leaders, providing them the uncompromising commentary, concise analysis, relevant tools and real-time reporting they need to succeed at work, profit from investing and have fun with the rewards of winning.

 

blog comments powered by Disqus

Latest stories

China to boost infrastructure in Tibet
Beijing, July 26 (IANS) China has vowed to upgrade the transport infrastructure in Tibet and expand the existing network of rail, road and air routes within the next six years.
 
 
Global film industry gender-biased: Study
London, July 26 (IANS) A study has revealed that only 22 percent of the crew involved in making 2,000 of the biggest grossing films worldwide over the past 20 years were women.
 
 
Nigeria fourth country in West Africa to report Ebola death
Accra, July 26 (IANS) Nigeria has become the fourth country in the West African region to record a death from the deadly Ebola disease, the country's Health Minister Onyebuchi Chukwu has confirmed.
 
 
Erotic thoughts key to female orgasm: Study
London, July 26 (IANS) Women who miss on orgasm should focus more on their their bodily sensations during intercourse and try to have more erotic thoughts during the act, a fascinating study reveals.
 
 
 

Latest from the Network

Pistol shooter Rahi wins gold, Anisa silver
Glasgow, July 26 (IANS) Indian shooter Rahi Sarnobat won the gold and Anisa Sayyed took silver in the women's 25 metre pistol event of the Commonwealth Games at the Barry Buddon Shooting Centre here Saturday. Playing...
Read more on Sport Balla
 
India beat Scotland 6-2 in hockey
Glasgow, July 26 (IANS) The Indian men's hockey team defeated Scotland 6-2 in their second Pool A match of the Commonwealth Games at the Glasgow National Hockey Centre here Saturday. After drubbing Wales 3-1 in the...
Read more on Sport Balla
 
Charlize Theron gets seal of approval from Sean Penn's daughter
Charlize Theron has gotten the seal of approval from Sean Penn's daughter. The 38-year-old actress has been dating Sean, 53, for the past eight months and his daughter Dylan, 23, from his marriage to Robin Wright, is...
Read more on Celebrity Balla
 
Liberty Ross and Rupert Sanders finalize divorce
Liberty Ross and Rupert Sanders have finalized their divorce. The former couple formally ended their marriage on Friday (25.07.14), two years after he was caught cheating with Kristen Stewart, according to TMZ which...
Read more on Celebrity Balla
 
Susan Sarandon reveals Bowie affair
Susan Sarandon says she had a love affair with David Bowie in the 1980s. The 67-year-old actress fell for the singer when they worked on the movie 'The Hunger' together in 1983 but split up because she didn't want...
Read more on Celebrity Balla
 
Sexual abuse lawsuit against Bryan Singer dropped
A sexual abuse lawsuit against Bryan Singer has been dropped. The 'X-Men: Days of Future Past' director was accused by an anonymous British actor - identified only as John Doe No. 117 - of abusing him as a teenager but...
Read more on Celebrity Balla
 
Shooters Rahi, Anisa ensure India two more medals
Glasgow, July 26 (IANS) Shooters Rahi Sarnobat and Anisa Sayyed ensured India another gold and silver after topping the women's 25-metre pistol semifinal at the Barry Buddon Shooting Centre to qualify for the gold...
Read more on Sport Balla
 
Lifter Meena 5th in women's 58 kg bronze
Glasgow, July 26 (IANS) Indian weightlifter Meena Kumari missed the bronze in the women's 58 kg category to finish fifth in the Commonwealth Games here Saturday. England's Zoe Smith, who won the bronze four years ago...
Read more on Sport Balla
 
India need Shami to fire at Rose Bowl
Hampshire, July 26 (IANS/RAY) If pacer Mohammed Shami fires in the third India-England Test match for the Pataudi Trophy starting at the Rose Bowl here Sunday, the tourists could be well placed to hold their own. The...
Read more on Sport Balla
 
Boxers Vijender, Manoj in last 16
Glasgow, July 26 (IANS) Indian boxers Vijender Singh and Manoj Kumar won their respective bouts to advance to the Round of 16 at the Commonwealth Games at the Scottish Exhibition and Conference Centre here Saturday....
Read more on Sport Balla