Let's start with this image:
Using Image Contour filter:
Using Kuwahara filter:
Using Chartizate filter:
Current running online implementation: Image train filters
yarn config set workspaces-experimental true
We need to provide two form-data parameters in a Multipart Formdata request. Use curl for that please. An example follows bellow.
- this is the where you load your image file in
- this is where you set your commands. there are only two examples at the moment:
- Kuwahara filter:
It smooths the image
- Image contour filter:
Processes differences in color ranges
These requests you can apply as many times as you like using a JSON request. Read following example for more.
{
"commands": [
{
"filter": "imageKuwahara",
"settings": [
{
"name": "square-size",
"value": "2"
},
{
"name": "iterations",
"value": "2"
}
]
},
{
"filter": "imageContour",
"settings": [
{
"name": "bgColor",
"value": "0xFFFFFF"
},
{
"name": "lnColor",
"value": "0x000000"
},
{
"name": "diffThreshold",
"value": "800000"
},
{
"name": "radius",
"value": "2"
}
]
}
]
}
You can use tools like postman, but you can also use curl. This is an example of such request:
$ curl -X POST --form [email protected] http://localhost:8080/images --form commands="{ \"commands\": [ { \"filter\": \"imageKuwahara\", \"settings\": [ { \"name\": \"square-size\", \"value\": \"2\"}, { \"name\": \"iterations\", \"value\": \"2\"} ]}, { \"filter\": \"imageContour\", \"settings\": [ { \"name\": \"bgColor\", \"value\": \"0xFFFFFF\"}, { \"name\": \"lnColor\", \"value\": \"0x000000\"}, { \"name\": \"diffThreshold\", \"value\": \"800000\"}, { \"name\": \"radius\", \"value\": \"2\"} ]} ] }"
Your results are stored wherever you define in your application.conf folder:
akka {
loglevel = DEBUG
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
}
service {
host = "localhost"
port = 8080
}
image-train-filters {
image-source-path = "/tmp/image-train-filters/sources"
image-destination-path = "/tmp/image-train-filters/destination"
}
Only important to note here that:
-
image-source-path -> This is where your original file is saved
-
image-destination-path -> This is where the resulting file is saved after applying the train of filters.
$ npm i -g npm
$ npm install -g @angular/cli
$ alias ng="/usr/local/lib/node_modules/@angular/cli/bin/ng"
$ npm cache clean -f
$ npm install -g n
$ n stable
$ echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list
$ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
$ apt-get update
$ apt-get install sbt
$ apt-get install default-jre
$ yarn install
$ yarn build
$ service nginx reload
- Akka Configuration Reference
- SBT release 1.5.0
- nginx: multiple websites on one server
- Set up multiple websites on a Digital Ocean droplet running nginx and node.js
- Fixing 413 Request Entity Too Large Errors
- Postman
- Update all the Node dependencies to their latest version
- How to fix 'Unsupported platform for [email protected]: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})