Skip to content

Rewrite to separate web app & interface from image processor #78

@jywarren

Description

@jywarren

It'd work like this:

// Initialize
var ig = new Infragram({webgl: false});

// Load an image:
ig.load('img.jpg');

// OR load an image object:
var img = new Image();
// stuff
ig.load(img);

// Now set an infragrammar expression: 
ig.apply('(R+G)/(R-G)');

// Get the resulting image back out as an Image object or otherwise:
ig.export();
ig.exportDataUrl();

// All in one step:
ig.filter('(R+G)/(R-G)', img);

// Or to filter and automatically replace an image element on a web page:
ig.filter('(R+G)/(R-G)', 'elementId');

And use https://github.com/Automattic/node-canvas to make runnable in NodeJS, and maybe even WebGL: https://github.com/mikeseven/node-webgl

If we did this, we'd be able to:

  • process images in MapKnitter on the fly
  • apply a composite in real time to a tileset, perhaps as a Leaflet plugin
  • run the whole thing on the commandline on a video file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions