Giter Club home page Giter Club logo

canvas-gif's Introduction

             *     ,MMM8&&&.            *
                  MMMM88&&&&&    .
                 MMMM88&&&&&&&
     *           MMM88&&&&&&&&
                 MMM88&&&&&&&&
                 'MMM88&&&&&&'
                   'MMM8&&&'      *
          |\___/|
          )     (             .              '                       newty.dev
         =\     /=                                          welcome to my github page (:
           )===(       *
          /     \
          |     |
         /       \
         \       /
  _/\_/\_/\__  _/_/\_/\_/\_/\_/\_/\_/\_/\_/\_
  |  |  |  |( (  |  |  |  |  |  |  |  |  |  |
  |  |  |  | ) ) |  |  |  |  |  |  |  |  |  |
  |  |  |  |(_(  |  |  |  |  |  |  |  |  |  |
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Rust          2 hrs 14 mins   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   69.12 %
Markdown      21 mins         โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   11.08 %
TypeScript    19 mins         โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   10.24 %
CSS           8 mins          โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   04.45 %
YAML          6 mins          โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   03.44 %

A little about me...

  • 17-year-old Computer Science student from the United Kingdom
  • You can find my current FOSS projects on codeberg
  • I stream on Twitch sometimes
  • I love cats :]

canvas-gif's People

Contributors

newtykip avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

canvas-gif's Issues

Gif is distorted + much faster

Code

import canvasGif from "canvas-gif"
import fs from "fs"

const gifUrl = "https://compote.slate.com/images/697b023b-64a5-49a0-8059-27b963453fb1.gif"

const makeGif = async () => {
	const response = await fetch(gifUrl)
	const arrayBuffer = await response.arrayBuffer()
	canvasGif(Buffer.from(arrayBuffer), (ctx, width, height, totalFrames, currentFrame) => {
		ctx.fillStyle = "#fff"
		ctx.font = "30px 'Fira Code Retina'"
		ctx.fillText("this is epic!?!", 50, 100)
		ctx.fillText(`Frame ${currentFrame}/${totalFrames}`, 50, 300)
	}, {}).then((buffer) => {
		fs.writeFileSync("./output.gif", buffer)
		console.log("Done!")
	})
}

makeGif()

Original gif

input

Modified

output

How can I fix the distortion? Also, is there a way to set the fps the same as the original gif? The problem isn't Buffer.from(arrayBuffer) because when I write that to ./output.gif directly, there is no distortion.

Example folder is gone :(

I'm too much of a noob to understand how to use this package and I would appreciate a small example to guide me.

API docs?

seems like an interesting project but can you let me know what features you support?

I'd like to overlay some images and text onto an animated GIF (eg memegenerator) is that possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.