Code Monkey home page Code Monkey logo

bat-sharp's Introduction

bat-sharp

中文

bat-sharp is a image batch processing tool.

Features:

  • image compress
  • image format convert

It base on fast-glob.js and sharp.js

Install

npm i bat-sharp -D

Usage

const { batSharp } = require('bat-sharp');

batSharp({
  inputArr: ['./images/*.png'],
  format: 'webp', // png jpeg webp avif and so on
  outputPath: './images2/',
  outputConfig: { // docs: https://sharp.pixelplumbing.com/api-output#png
    quality: 60,
  },
  maintainRelativePath: true,  // <-- this value is true by default
})

Why

you can use https://tinypng.com/ to image compress when you has a few images;

but tinypng will limit you if you has hundreds of images; tinypng says that it can compress 20 images once a time, however it can't do this actually when you upload images continually. it only compress less than 20 images at a time.

you need wait some minutes for next upload operation;

In a word,compressing hundreds of images will waste you amounts of time;

In addition, if you want convert your png or jpg images to other format, this site can't help you;

so, bat-sharp was born!

It's very tiny and fast!

Try it!

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.