Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/longlho/node-gm-native

Native GraphicsMagick++ addon for Node
https://github.com/longlho/node-gm-native

Last synced: about 2 months ago
JSON representation

Native GraphicsMagick++ addon for Node

Awesome Lists containing this project

README

        

gm-native
=========

[![Build Status](https://travis-ci.org/longlho/node-gm-native.svg?branch=master)](https://travis-ci.org/longlho/node-gm-native)

Native binding for GraphicsMagick++. Some details can be found in this [blog post](https://medium.com/@longho/getting-cozy-with-node-native-add-ons-be045e2f2386).

Quick usage:

```javascript

var gm = require('gm-native');

var outputBuffer = gm.convert(
// Required. Can also be URL, file path or Buffer object. Note that GM is IO-blocking so using path/URL will block the process
'test.jpg',
// Required. Operations, just like arguments you'd pass to `convert` process
['scale', '100x100^', 'quality', 75, 'format', 'WEBP', 'extent', '100x100', 'CenterGravity', 'blurSigma', 5],
// Required, callback function
callbackFn
});
```

Supported methods
---

**NOTE**: Orders do matter

- `['strip']`
- `['interlace', '']`
- `['scale', 'x']`
- `['extent', 'x']`
- `['format', '']`
- `['quality', '<0 - 100>']`
- `['filter', '']`
- `['blurSigma', '']`

TODO
---

- Figure out optional width & height
- More tests
- Composite (for rounded corners...)