ndarray-pixel-sort

1.0.0 • Public • Published

ndarray-pixel-sort experimental

A JS implementation of Kim Asendorf's pixel sort glitch technique using ndarrays.

Works in the browser using browserify, or server-side with Node.

ndarray-pixel-sort

Usage

NPM

sort(image, filterfn, sortfn)

Applies a pixel sort to an image.

  • image: the ndarray image to sort. Modified in-place.
  • filterfn(r, g, b): takes the color of a pixel and returns true if it should be sorted.
  • sortfn(a, b): a sort comparison function that takes two color [r, g, b] arrays – should return 0 if equal, above 0 if a > b and below 0 if a < b.

Check the code in test.js for example usage.

License

MIT. See LICENSE.md for details.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i ndarray-pixel-sort

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hughsk