IMGART it's an HTTP service for image processing based on filters and profiles.
Documentation: https://imgart.onrender.com/api/v1/docs
- Image manipulation
- Image caching (Redis)
- Predefined Profiles (MongoDB)
- API Documentation (Swagger Specification)
- Error Handling
- Docker
- Debugging using Delve and Docker
- Makefile
- Testing
- Graceful shutdown
- Healthcheck
- Dockerfile (Development)
- Dockerfile.CI (Production)
- docker-compose.yml (Run application)
- docker-compose.debug.yml (Run application with delve for debugging)
- Clone repository:
git clone [email protected]:Talento90/imgart.git
- Install dependencies:
make deps
- Run using docker:
docker-compose up
ormake docker
- Open application:
open http:localhost:4005
{host}/api/v1/images?imgSrc={0}&profile={1}&filters={2}
- host: Server address
- imgSrc: Image URL
- profile: Profile we want to apply
- filters: List of filters to process
Example
https://imgart.onrender.com/api/v1/images?imgSrc=https://goo.gl/mq7yPD&profile=example&filters=[{"id":"rotate","parameters":{"angle":-90}}]
Result
The engine behind image manipulation is the fabulous library: github.com/disintegration/
Available Effects
It's possible to combine multiple effects:
/api/v1/images?imgSrc=https://raw.githubusercontent.com/Talento90/imgart/master/assets/gopher.png&filters=[{"id":"overlay","parameters":{"position":[25,75],"url":"https://goo.gl/UBrXeo"}},{"id":"overlay","parameters":{"position":[22,-35],"url":"https://goo.gl/aEkkDh"}}, {"id":"crop","parameters":{"rectangle":[0,0,202,150]}}]
If you don't want to specify filters in URL, you can create a profile with all pre configured filters and then use it in query parameters &profile={profile-id}
.
Create Profile
POST /api/v1/profiles
{
"id": "my-profile",
"filters": [
{ "id": "brightness", "parameters":{ "percentage":0.3}},
{ "id": "crop", "parameters":{"rectangle":[0,0,100,200]}}
]
}
Using profile in query parameters
GET /api/v1/images?imgSrc={image url}&profile=my-profile