SDWebImage / SDWebImageBPGCoder

A BPG coder plugin for SDWebImage, use libbpg
MIT License
11 stars 2 forks source link

Support BPG encoding for static && animted BPG images #3

Closed dreampiggy closed 5 years ago

dreampiggy commented 5 years ago

I take some times to implements the BPG encoding feature. Solve #1

The official libbpg does not support it. Maybe because the BPG encoding is really time-consuming. However, the BPG have a command line tool bpgenc. I write the wrapper and polish the APIs to make it works without the need to use as command line tool. (It's not hard but contains some edge cases...)

And, for BPG encoding, the codec need a extra dependency x265. Which is used to encode HEVC bitstream. However, x265 is under GPL licence or commercial licence. So this does not provided as default subspecs and I've update the licence description.

Tested with the current demo 003.bpg (static BPG), cinemagraph-6.bpg (animated BPG), all works. The animated BPG encoding take 3 seconds to finished. So keep patient 🐱

dreampiggy commented 5 years ago

The original bpgenc files is based on the libbpg's source files here: libbpg/bpgenc.c