Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Split background image and pack them as CSS sprite #213

Open
coolwanglu opened this issue Oct 1, 2013 · 1 comment
Open

Split background image and pack them as CSS sprite #213

coolwanglu opened this issue Oct 1, 2013 · 1 comment
Labels

Comments

@coolwanglu
Copy link
Owner

For raster images only.
A good algorithm: http://www.codeproject.com/Articles/210979/Fast-optimizing-rectangle-packing-algorithm-for-bu

Another algorithm: https://github.com/yostudios/Spritemapper

@X4
Copy link

X4 commented Apr 1, 2014

Good idea, but this only makes only sense for packing small images. Therefore you need a 2nd compilation phase, which packs all images with a dimension less than 10% of the source canvas into one mega-sprite.

It means that only on PDFs with many small images you will have a noticeable impact on file-size and load-time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@X4 @coolwanglu and others