Giter VIP home page Giter VIP logo

mm-file-image's Introduction

Matter In Motion. Image processor for file extension

NPM Version NPM Downloads

This is processor for the file extension.

Usage

Extensions installation instructions.

Methods

resize

  • name — can be added to the file name in result
  • to — filepath to save to. (More info)[https://github.com/matter-in-motion/mm-file]
  • width — number
  • height — number
  • mask — path to mask file, relative to media path
  • blur — [radius, sigma]
  • fit — fit option, default clip
    • clip — resizes the image to fit within the width and height boundaries without cropping or distorting the image. The resulting image will match one of the constraining dimensions, while the other dimension is altered to maintain the same aspect ratio of the input image.
    • crop — resizes the image to fill the width and height dimensions and crops any excess image data. The resulting image will match the width and height constraints without distorting the image.
    • max — resizes the image to fit within the width and height dimensions without cropping or distorting the image, but will not increase the size of the image if it is smaller than the output size. The resulting image will maintain the same aspect ratio of the input image.
    • min — resizes and crops the image to match the aspect ratio of the requested width and height. Will not exceed the original width and height of the image.
    • scale — scales the image to fit the constraining dimensions exactly. The resulting image will fill the dimensions, and will not maintain the aspect ratio of the input image.
  • gravity — string, default center. north, east, south, west, northeast, southeast, southwest, northwest, center, entropy, attention
    • entropy — focus on the region with the highest Shannon entropy.
    • attention — focus on the region with the highest luminance frequency, color saturation and presence of skin tones.

entropy and attention are not available for gif output

  • type — output file type or "auto", object with type options
    • id — output format (auto or jpeg, png, gif, etc...)
    • quality — number 1..100 (can be vary check different formats options)

The image processor can accept an array of values. It will find the closest width/height ratio for the provided image.

GIF

If you need to write to gif format you have to install gifsicle

License MIT

© velocityzen

mm-file-image's People

Contributors

velocityzen avatar

Watchers

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