PHP Classes

CSS sprite class: Generate sprite images and CSS to use image styles

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 59%Total: 1,498 All time: 2,616 This week: 455Up
Version License PHP version Categories
css-sprite-class 1.0.0GNU General Publi...5.0HTML, PHP 5, Graphics
Description 

Author

This class can be used to generate sprite images and CSS to use image styles to use the sprites in Web pages.

It can take a list of images and generates a single sprite image with all the images inside.

The class can also generate CSS style definitions to use in Web pages that need to use the images from the generated sprite image.

Innovation Award
PHP Programming Innovation award nominee
October 2010
Number 2


Prize: One book of choice by Packt
Web pages with many images force the browser to make too many requests to the Web server.

An alternative solution to reduce the number of requests consists in assembling several images into a single sprite image. Then use CSS styles that define how to clip each image from the sprite and use the image in the Web pages.

This class implements a PHP solution to assemble sprite from a list of images and the necessary CSS styles to use the images in the pages.

Manuel Lemos
Picture of Arturs Sosins
  Performance   Level  
Name: Arturs Sosins <contact>
Classes: 22 packages by
Country: Latvia Latvia
Age: 36
All time rank: 521 in Latvia Latvia
Week rank: 50 Up1 in Latvia Latvia Equal
Innovation award
Innovation award
Nominee: 13x

Winner: 2x

  Files folder image Files (7)  
File Role Description
Files folder imageexamples (3 files)
Files folder imagetest_images (3 files)
Plain text file css_sprite.class.php Class Main class file

  Files folder image Files (7)  /  examples  
File Role Description
  Accessible without login Plain text file css_code_example.php Example CSS code generation example
  Accessible without login Plain text file download_sprite_example.php Example CSS sprite forcing download example
  Accessible without login Plain text file image_output_example.php Example CSS sprite output example

  Files folder image Files (7)  /  test_images  
File Role Description
  Accessible without login Image file elephpant.png Icon Test png file
  Accessible without login Image file php.gif Icon Test gif file
  Accessible without login Image file php.jpg Icon Test jpg file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,498
This week:0
All time:2,616
This week:455Up
User Ratings User Comments (1)
 All time
Utility:85%StarStarStarStarStar
Consistency:80%StarStarStarStarStar
Documentation:-
Examples:85%StarStarStarStarStar
Tests:-
Videos:-
Overall:59%StarStarStar
Rank:1361
 
Very nicely done.
13 years ago (Tom Carnevale)
70%StarStarStarStar