imgflo-server is an image-processing server with HTTP built using the imgflo dataflow runtime.
See ./CHANGES.md
MIT
Note: GEGL itself is under LGPLv3.
The imgflo server provides a HTTP API for processing images:
GET /graphs/mygraph?input=http://example.com/input-image.png&attr1=value1&....
When the server gets the request, it will:
- Download the specified
inputimage over HTTP(s) - Find and load the graph
mygraph - Set attribute,value pairs as IIPs to the exported ports of the graph
- Processes the graph using a runtime
* - Stores the output image to disk
- Serve the output image over HTTP
Note: In step 4, currently a new runtime is spawned for each request, and communication done through stdin. In the future, the runtime will be a long-running worker, and communication done using the FBP runtime protocol.
*In addition to supporting the native imgflo runtime,
the server can also execute graphs built with NoFlo w/ noflo-canvas.
- Forming valid imgflo urls: imgflo-url
- Creating responsive images using media-query: rig
imgflo-server can easily be extended with new image processing pipelines, either using a text-based DSL or Flowhub node-based visual IDE.
See Adding Graphs
Currently our deployed instance is only for The Grid. If you are interested in access to hosted version, send us an email: support@thegrid.io
Register/log-in with Heroku, and create a new app. First one is free.
After creating the app, login at Heroku:
heroku login
Clone imgflo-server:
git clone https://github.com/jonnor/imgflo-server.git
cd imgflo-server
Add YOURAPP as remote:
heroku git:remote -a YOURAPP
Specify the multi buildpack with build-env support, either at app creation time, in Heroku webui or using
heroku config:set BUILDPACK_URL=https://github.com/mojodna/heroku-buildpack-multi.git#build-env
Configure some environment variables (hostname, port and local image cache):
heroku config:set HOSTNAME=YOURAPP.herokuapp.com
heroku config:set PORT=80
Deploy, will take ~1 minute
git push heroku master
You should now see the imgflo server running at http://YOURAPP.herokuapp.com
If everything is OK you should be able to see a generative image at http://YOURAPP.herokuapp.com/graph/delaunay_triangles?seed=foobar&height=800&width=600
Note: imgflo has only been tested on GNU/Linux systems. Root is not needed for any of the build.
imgflo requires git master of GEGL and BABL, as well as a custom version of libsoup. It is recommended to let make setup this for you, but you can use existing checkouts by customizing PREFIX. You only need to install the dependencies once, or when they have changed.
git submodule update --init
make dependencies
If you are on an older distribution, you may also need a newer glib version
# make glib # only for older distros, where GEGL fails to build due to too old glib
Install node.js dependencies
npm install
Now you can build & install imgflo itself
make install
To verify that things are working, run the test suite
make check
node index.js
You should see your server running at http://localhost:8080
