Sharing Top Content from the Angular-sphere.

node-flif: A Node Wrapper for the FLIF Image Compressor – (FLIF is a lossless image format…

  • pam output , async , Set to false to run this as a synchronous encoding overwrite , Set to true to overwrite existing files on output (default is false) effort , interlace , true, false, or ‘auto’ (interlacing except on tiny images) (default is ‘auto’) encodeQuality , 0-100, where 99…
  • (default is [100] which applies to all frames) maxPaletteSize , Max number of colors to store in a FLIF palette.
  • (FLIF default is 512) colorBuckets , channelCompact , ycocg , false will disable YCoCg transform and use G(R-G)(B-G) (default is true) subtractGreen , false will disable YCoCg and SubtractGreen transform and use GRB (default is true) frameShape , maxFrameLookBack , Max number of frames for Frame_Lookback (allows -1-256, default is…
  • pam async , Set to false to run this as a synchronous decoding overwrite , Set to true to overwrite existing files on output (default is false) decodeQuality , keepMetaData , Set to false to strip EXIF/XMP metadata (default is true) keepColorProfile , Set to false to strip ICC color…
  • (default is false) scale , resize { Lossy downscaled image to fit inside given Width/Height (default uses input dimensions) width , height }, fit { Lossy downscaled image to exactly the given Width/Height (default uses input dimensions) width , height } }; By default encode is asynchronous, and can accept…

GitHub is where people build software. More than 27 million people use GitHub to discover, fork, and contribute to over 80 million projects.

Star this repo to increase the amount of FLIF in the world.

FLIF is a lossless image format designed with the web in mind. It has lots of great features. To learn more about the format go to FLIF.info.

This repository is for a Node.js module that wraps around a native executable for your platform. That executable performs the actions of encoding or decoding FLIF files. This wrapper allows you to pass in a javascript object containing your settings into a function that will create the commandline arguments for you and then run them against the executable CLI. It will also warn you if you pass in the wrong parameters or types of data.

Since node-flif wraps around a native executable and references the file system, it cannot be ran in a browser.

If you would like to encode/decode flif files in a browser look into other projects like:

Here is the basic encode, decode, transcode usage. Detailed API below.

var nodeFLIF = require(‘node-flif’); var path = require(‘path’); var encodeParams = { input: path.join(process.cwd(), ‘your-file.png’), output: path.join(process.cwd(), ‘new-file.flif’) }; nodeFLIF.encode(encodeParams, function (data) { console.log(‘Encode finished.’); if (data) { console.log(data); } });

var nodeFLIF = require(‘node-flif’); var path = require(‘path’); var encodeParams = { input: path.join(process.cwd(), ‘your-file.png’), output: path.join(process.cwd(), ‘new-file.flif’), async: false }; var data = nodeFLIF.encode(encodeParams); console.log(‘Encode finished’); if (data) { console.log(data); }

var nodeFLIF = require(‘node-flif’); var path = require(‘path’); var decodeParams =…

GitHub