https://github.com/advplyr/node-css-image
Apply css filters to an image in nodejs and save
https://github.com/advplyr/node-css-image
Last synced: 10 months ago
JSON representation
Apply css filters to an image in nodejs and save
- Host: GitHub
- URL: https://github.com/advplyr/node-css-image
- Owner: advplyr
- Created: 2021-03-25T01:07:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-30T14:21:56.000Z (over 4 years ago)
- Last Synced: 2025-02-23T02:44:25.151Z (10 months ago)
- Language: JavaScript
- Size: 163 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node CSS Image
Apply css filters to an image in nodejs and save.
**Puppeteer v8**
## Installation
```bash
$ npm install node-css-image
```
## Usage
```js
const path = require('path')
const CssImage = require('node-css-image')
const samplePayload = {
src: 'https://www.w3schools.com/CSSref/pineapple.jpg',
height: 300,
width: 300,
filters: {
sepia: 0.5,
brightness: 1.25,
saturate: 2
},
output: path.join(__dirname, 'sample2-output.png')
}
CssImage.save(samplePayload).then(() => console.log('Done')).catch((error) => {
console.error('Failed', error)
})
```
## License
[MIT](https://choosealicense.com/licenses/mit/)