1.0.1 • Published 3 years ago

peanutbuttergif v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

PeanutButterGIF Comfiest GIF Decoder for the Web!

npm GitHub npm.io

Special thanks to @AlcaDesign for the help in getting Gifuct-js library packaged into a parcel and parsing the frames!

JSGif

We built this GIF decoder live on Twitch on Instafluff!

Instafluff

Like these projects? The best way to support my open-source projects is by becoming a Comfy Sponsor on GitHub!

https://github.com/sponsors/instafluff

Come and hang out with us at the Comfiest Corner on Twitch!

https://twitch.tv/instafluff

Instructions

  1. Download and add pbgif.min.js from the dist folder or include from the JSDelivr CDN:
<script src="pbgif.min.js"></script>

OR

<script src="https://cdn.jsdelivr.net/npm/peanutbuttergif@latest/dist/pbgif.min.js"></script>
  1. Get the GIF frames by calling await fetchGif( url ) and that's it!

For Example:

( async () => {
	let gifData = await fetchGif( "https://media.giphy.com/media/6E5UgTuvUR0b3OLgWV/giphy.gif" );
	console.dir( gifData );
})();

Example rendering of the pixel data to canvas is in dist/example.html