All Projects → richardanaya → ImageStorage.js

richardanaya / ImageStorage.js

Licence: MIT license
A simple library for using PNG images as key value pair data holders. MIT LICENSE

Programming Languages

javascript
184084 projects - #8 most used programming language

ImageStorage.js

ImageStorage.js is a simple library for using PNG images as string key value pair data holders. MIT LICENSE

Example Usage:

var imgStore = ImageStorage.loadFromURL("duck.png");
var imgStore = ImageStorage.loadFromImage($('#duckImg').get(0));
var imgStore = new ImageStore(new Uint8Array([...]));

imgStore.set("foo","bar");
imgStore.get("foo");
imgStore.remove("blah");

imgStore.save(function(img){
    //do something with image+data
});

Important Notes:

  • This library requires support for Uint8Array
  • Key value pairs stored as tEXt chunks
  • There are many types of PNG specs, this may not work with all
  • Many image hosting services pngcrush/reduce/modify images to reduce size
  • Have fun!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].