Git Product home page Git Product logo

imgproc's Introduction

imgproc

Simple image processing service.

Install

git clone [email protected]:iamso/imgproc.git
cd imgproc
npm install

Usage

Run normally:

npm start

Run in dev mode:

npm run dev

Default port is 8000, but can be set via environment variable:

PORT=1234 npm start
# or
PORT=1234 npm run dev

Options

Option Type Description
url String The url to the image to process. Must be url encoded.
width Number Optional. The width of the output image.
height Number Optional. The height of the output image.
fit String Optional. The fit of the output image. Can be cover, contain, fill, inside or outside. Default is cover.
background String Optional. The background color of the output image, visible i.e. if fit is contain. Expects a hex color, without the #, i.e. ff0000.
flip - Optional. If present, the output image is flipped on the Y axis.
flop - Optional. If present, the output image is flipped on the X axis.
rotate Number Optional. The angle for the rotation of the output image.
greyscale - Optional. If present, the output image is converted to greyscale.
negate - Optional. If present, the output image is converted to negative.
normalize - Optional. If present, the output image is normalized.

Here is a url using all the options:

https://imgproc.your.tld/?url=https%3A%2F%2Fplaceimg.com%2F1000%2F1000%2Fany&width=300&height=200&fit=contain&background=ff0000&flip&flop&rotate=45&greyscale&negate&normalize

The image url can also be passed as a route parameter.

https://imgproc.your.tld/https%3A%2F%2Fplaceimg.com%2F1000%2F1000%2Fany?width=300&height=200&fit=contain&background=ff0000&flip&flop&rotate=45&greyscale&negate&normalize

If no options are passed, it just acts as a proxy.

Caveats

This service uses sharp for image processing and currently there is an issue running this on now.sh.

License

ISC License

imgproc's People

Contributors

iamso 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.