https://github.com/fetchandadd/ipms
Image processing microservice
https://github.com/fetchandadd/ipms
docker image-processing imagemagick lua microservice nginx openresty
Last synced: about 1 month ago
JSON representation
Image processing microservice
- Host: GitHub
- URL: https://github.com/fetchandadd/ipms
- Owner: fetchandadd
- License: mit
- Created: 2017-04-20T07:12:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-26T11:05:50.000Z (about 9 years ago)
- Last Synced: 2025-03-10T16:44:44.446Z (over 1 year ago)
- Topics: docker, image-processing, imagemagick, lua, microservice, nginx, openresty
- Language: Lua
- Size: 18.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ipms
Image processing microservice
## API
For the following examples [HTTPie](https://httpie.org/) is used to manage HTTP connections.
### Basic commands
Ipms provides the following basic commands. A command consist of a path fragment (e.g. `rotate`) and a GET parameter (e.g. `degrees`). The path fragment triggers the execution of the specific command and the GET parameter delivers the value.
A request `/rotate?degrees=90` can be seen as a function call `rotate(, degrees=90)`.
#### Blur
* Blur the image with sigma=20 and radius=50
```bash
http localhost:8080/v1/imagemagick/blur sigma==20 radius==50 < source.jpg > target.png
```
#### Format
* Format set to PNG
```bash
http localhost:8080/v1/imagemagick/format format==png < source.jpg > target.png
```
#### Quality
* Quality set to 95%
```bash
http localhost:8080/v1/imagemagick/quality quality==95 < source.jpg > target.jpg
```
#### Rotate
* Rotate the image to 90° (clockwise)
```bash
http localhost:8080/v1/imagemagick/rotate degrees==90 < source.jpg > target.jpg
```
#### Thumb
* Crop to 500 by 300 at position 10,20
```bash
http localhost:8080/v1/imagemagick/thumb size==500x300+10+20 < source.jpg > target.jpg
```
### Combine multiple commands
Commands will be executed from left to right. E.g. a request `/thumb/rotate?size=500x300+10+20°rees=90` translates to `rotate(thumb(, size=500x300+10+20), degrees=90)`.
#### Thumb + Rotate
* Crop to 500 by 300 at position 10,20
* Rotate the image to 90° (clockwise)
```bash
http localhost:8080/v1/imagemagick/thumb/rotate size==500x300+10+20 degrees==90 < source.jpg > target.jpg
```