Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fthuin/nativescript-image-black-and-white
NativeScript plugin to turn images into black-and-white images
https://github.com/fthuin/nativescript-image-black-and-white
filter images nativescript typescript
Last synced: 20 days ago
JSON representation
NativeScript plugin to turn images into black-and-white images
- Host: GitHub
- URL: https://github.com/fthuin/nativescript-image-black-and-white
- Owner: fthuin
- License: apache-2.0
- Created: 2018-04-21T11:53:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-21T13:19:21.000Z (over 6 years ago)
- Last Synced: 2024-11-10T19:08:34.651Z (about 2 months ago)
- Topics: filter, images, nativescript, typescript
- Language: TypeScript
- Size: 2.24 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nativescript-image-black-and-white
This plugin allows you to put an image in black and white (also called gray scale filter). It is using native iOS and Android features, so it is very nice in terms of performance and **it does not contain any third-party library** so it is very small.
Original | Modified
:-------------------------:|:-------------------------:
|Original | Modified
:-------------------------:|:-------------------------:
|## Installation
```bash
tns plugin add nativescript-image-black-and-white
```## Usage
```typescript
import { Image } from 'tns-core-modules/ui/image';
import { ImageBlackAndWhite } from 'nativescript-image-black-and-white';const image: Image = ...; // Initialize or get your image
const imageBlackAndWhite = new ImageBlackAndWhite();
imageBlackAndWhite.blackAndWhite(image);
```Do not hesitate to look at the demo for a working example (screenshots come from there).
## API
This library is very simple, you create a new instance of `ImageBlackAndWhite`, you call the only method which is `blackAndWhite` with a Nativescript Image as parameter.
```
class ImageBlackAndWhite {
blackAndWhite(img: Image): void;
}
```## Thanks
Thanks to NativeScript team for the the plugin-seed and demo app template.
Thanks to Brad Martin for its implementation of [nativescript-image-filters](https://github.com/bradmartin/nativescript-image-filters).
## License
Most of the code comes from NativeScript team (plugin-seed and demo app) :
Apache License Version 2.0, January 2004iOS implementation comes from [nativescript-image-filters](https://github.com/bradmartin/nativescript-image-filters) released by Brad Martin under MIT License.
My implementation for Android is under WTFPL.