Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/apply-colormap
Applies a colormap to an ndarray
https://github.com/mikolalysenko/apply-colormap
Last synced: about 2 months ago
JSON representation
Applies a colormap to an ndarray
- Host: GitHub
- URL: https://github.com/mikolalysenko/apply-colormap
- Owner: mikolalysenko
- License: mit
- Created: 2014-03-22T16:07:18.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-08-13T01:45:14.000Z (over 6 years ago)
- Last Synced: 2024-10-20T14:28:00.677Z (2 months ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 14
- Watchers: 6
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
apply-colormap
==============
Applies a color map to an ndarray.# Example
```javascript
var imshow = require("ndarray-imshow")
var colorize = require("apply-colormap")
var fill = require("ndarray-fill")
var zeros = require("zeros")var x = zeros([512, 512])
fill(x, function(a,b) {
return a*a + b*b
})imshow(colorize(x))
```# Install
```
npm install apply-colormap
```# API
### `require("apply-colormap")(array[, options])`
Applies a colormap to an ndarray* `array` is an ndarray
* `options` is an object containing a list of properties to apply to the array+ `colormap` determines the colormap to use (default "jet"). Names are consistent with the [`colormap`](https://www.npmjs.org/package/colormap) package.
+ `min` determines the lowest color in the image
+ `max` determines the highest color in the image
+ `outBuffer` is an optional buffer into which the output is written**Returns** An ndarray representing the colorized image or volume
# Credits
(c) 2014 Mikola Lysenko. MIT License