Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Jul 30, 2018
1 parent 7c608e8 commit d907c03
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ If you're using webpack you can set `process.browser` to true and your build of

## Basic usage

The static `Jimp.read` method takes the path to a PNG, JPEG or BMP file and returns a Promise:
The static `Jimp.read` method takes the path to a file, URL, dimensions, a Jimp instance or a buffer and returns a Promise:

```js
Jimp.read('./path/to/image.jpg')
Expand All @@ -73,11 +73,7 @@ Jimp.read('./path/to/image.jpg')
.catch(err => {
// handle an exception
});
```

The method can also read a PNG, JPEG or BMP buffer or from a URL:

```js

Jimp.read(lenna.buffer)
.then(image => {
// do stuff with the image
Expand All @@ -95,6 +91,8 @@ Jimp.read('http://www.example.com/path/to/lenna.jpg')
});
```

The conveniance method `Jimp.create` also exists. It is just a wrapper around `Jimp.read`.

### Basic methods

Once the promise is fulfilled, the following methods can be called on the image:
Expand Down

0 comments on commit d907c03

Please sign in to comment.