Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


Ties together streaming image encoders and decoders with a nice API

Subscribe to updates I use pics

Statistics on pics

Number of watchers on Github 33
Number of open issues 0
Main language JavaScript
Average time to merge a PR 6 days
Open pull requests 0+
Closed pull requests 0+
Last commit over 4 years ago
Repo Created about 5 years ago
Repo Last Updated about 2 years ago
Size 171 KB
Organization / Authordevongovett
Page Updated
Do you use pics? Leave a review!
View pics activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating pics for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


Ties together streaming image encoders and decoders with a nice API. It handles the following concerns:

  1. Probing images for their file format on the first chunk and proxying to the correct decoder.
  2. Finding and initializing image encoders based on mime type.
  3. Performing the necessary color conversions to encode an image, depending on the supported color spaces of the image format. This includes quantization in the case of indexed image formats such as GIF.


npm install pics


The following example registers some image codec plugins, resizes a PNG file, and converts it to a JPEG.

var pics = require('pics');
var resize = require('resizer-stream');

// register some image codecs

// convert a PNG to a JPEG
  .pipe(resize({ width: 300, height: 300, fit: true }))

Notice that nowhere is a PNG decoder explicitly created: it is created for us automatically by probing the first few bytes of a file. You could just as easily pipe a GIF to pics.decode() and convert it to a JPEG with no code modifications.



Registers a image codec plugin. Should be an object with the following properties:

  • Decoder - the image decoder class. Should be a transform stream.
  • Encoder - the image encoder class. Should be a pixel-stream.
  • mime - the mime type for this image format.

You can register only a decoder by including only a Decoder property. To register only an encoder, include the Encoder and mime properties.

The Decoder class should have a static probe method that accepts a buffer and returns a boolean to determine whether the image format can be handled by that decoder.

The Encoder class should have a supportedColorSpaces property, which is an array listing the color spaces supported by this image format. Color space conversion using the color-transform and neuquant modules may be performed prior to data being passed to the encoder if the input color space is not one of the supported color spaces of this encoder.

For examples of image codecs, check out the following modules:


Returns a decoder stream that probes the image to find an available decoder for the file. The options are passed to the underlying decoder class.

pics.encode(mime, options)

Returns an encoder stream for the given mime type. The options are passed to the underlying encoder class. Depending on the input to this stream, color space conversion or quantization may be necessary, and will be performed before the data is sent to the underlying image encoder.



pics questions on Stackoverflow (View All Questions)
  • i want to get all related pics corresponding to the pic selected
  • Open iCloud Pics in my app
  • Display ip camera pics store in server on webpage with refresh
  • Python / Django - creating a photo gallery - get pics' names instead of pics themself
  • Downloading pics via R Programming
  • Save ppt links as pics code review (broken after updating office)
  • PHP PayPal Express Checkout IPN Not Completing Sale (Pics)
  • How to save image in SQL image type column from picturebox without mentioning pics url?
  • How to get user's pics who likes our post using restfb?
  • Getting images from itunes rss feed and putting the pics in a bxslider
  • Live Message Wall with Social Profile Pics
  • Thread for show pics while a function is running
  • Display pics while a function is on execution
  • Api instagram get more than 20 pics
  • Auto Save & Capture Pics in Front Cam iOS Swift
  • Generating two random pics from a list of objects? Visual Basic
  • Arrow keys change pics Javascript
  • How to get twitter profile pics URL in iOS now?
  • How can I put text below the pics?
  • Meteor pics review template
  • Getting only 1000 pics from Google Picasa, I am using &showAll
  • ios 9 CVOpenGLESTextureCacheCreateTextureFromImage error when taking pics with iphone
  • Eliminate Padding/Margin around Pics in <td> elements
  • Pics to movie with fade transition
  • Image Gallery with support names and pics
  • turn off caching pics in Lightbox2
  • Upload multiple files/pics with 1 submit button
  • How to get friends profile pics using FQL query using FBGraph-API
  • Programming new PICs with PICStart+ from MPLAB 8
  • joining two pics seamlessly in a div
pics list of languages used
Other projects in JavaScript