Git Product home page Git Product logo

lqip-api's Introduction

LQIP-API

A microservice for generating LQIP images from a POST, in a customizable and configurable way.

Example

Note the --data-binary flag

curl localhost:9980 --data-binary @testimg.jpg -o out.svg

Server Flags

Flag Type Default Description
--port (-p) int 80 Port to listen on
--async (-a) bool false Allow drop-off/pickup async requests
--cacheLife int 600 Time (in seconds) an async svg should be stored (When async enabled)
--cacheGC int 900 Cadence (in seconds) in between scraping cache for expired content (When async enabled)
--postback (-r) bool false Allow drop-off/send-back async requests
--defaultShapeCount (-s) int 16 Default number of shapes in an LQIP
--allowShapeCountQP bool true Allow user to specify non-default shape count
--maxShapeCountQP int 32 Maximum user shape count specifiable
--defaultMode (-m) int 1 Default type of shape to generate for the LQIP (See Modes)
--allowedModeQPs string "012345678" Allowable modes specifiable by user (See Modes)
--blur (-b) int 12 Default level of Gaussian blur filter
--allowBlurQP bool true Allow user to specify different blur level

Request Query Parameters

Name Type Description
shapecount int Number of shapes to generate in LQIP
mode int Type of shapes to generate (See Modes)
blur int Strength of Gaussian blur filter
postback string Url to post finished product back to (in postback mode)

Modes

Mode Shape
0 Mixed Set (1, 2, 6)
1 Triangles
2 Rectangles
3 Ellipses
4 Circles
5 Rotated Rectangles
6 Rotated Ellipses
7 Beziers (Use with higher shape count)
8 Freeform Polygons

Dockerized

Example startup:

Totally basic/default: docker run --rm -p 9980:80 lqip-api:0.0.0

Pass args: docker run --rm -p 9980:80 lqip-api:0.0.0 -ar

Host networking: docker run --rm --network=host lqip-api:0.0.0 -ar -p 9980

lqip-api's People

Contributors

sircinnamon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.