const fs = require("fs"); const omg = require("omggif"); const { execSync } = require('child_process'); execSync("rm -rf data_compress") // load gif const gif_raw = fs.readFileSync("../assets/out.gif"); const gif_data = new omg.GifReader(gif_raw); const num_pixel = gif_data.width * gif_data.height; const num_frames = gif_data.numFrames(); const pallete = []; var maxLength = 0; var pallete_name; var buffer = new Uint8Array(num_pixel * 4) var prevFrame = new Uint8Array(num_pixel * 4) var buffer_formatted = new Uint16Array(num_pixel); for (let i=0; i>3)|(((g)>>3)<<5)|(((b)>>3)<<10)) }