Skip to content

kaiinui/Swift-UICollectionView-WebP

Repository files navigation

Swift-UICollectionView-WebP

UICollectionView + WebP w/SDWebImage

pod 'SDWebImage/WebP' provides the easiest way to handle WebP image, as easy as JPEG. Just use provided UIImageView extension imageView.setImageWithURL(NSURL(string: "http://path/to/image.webp")) to handle WebP.

The example shows number of same WebP image (2642 bytes) with cache-preventing hack. To provide same size/quality JPEG image, its size goes to 12,016 bytes. (approximately 5x)

Please note while you are scrolling down, images will be loaded from network, not from local disk.

#Note

  • Performance.
    1. As WebP needs software decoding, decoding overhead gets longer than JPEG's.
    2. For smaller sized images, decoding overhead seems to be longer than network overhead.
    3. For bigger sized images, network overhead will get enough to consider WebP? It needs further research.

About

UICollectionView + WebP w/SDWebImage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages