<commit_before>[![Version](http://img.shields.io/npm/v/lwip.svg)](https://www.npmjs.org/package/lwip)
[![Build Status](https://api.travis-ci.org/EyalAr/lwip.svg?branch=master)](https://travis-ci.org/EyalAr/lwip)
[![Coverage Status](https://img.shields.io/coveralls/EyalAr/lwip/master.svg)](https://coveralls.io/r/EyalAr/lwip)

# Light-weight image processor for NodeJS

0. [Overview](#overview)
  0. [Installation](#installation)
  0. [Usage](#usage)
  0. [Supported formats](#supported-formats)
  0. [Colors specification](#colors-specification)
  0. [Note on transparent images](#note-on-transparent-images)
0. [API](#api)
  0. [Open an image from file or buffer](#open-an-image)
  0. [Create a new blank image](#create-a-new-image)
  0. [Image operations](#image-operations)
    0. [Resize](#resize)
    0. [Scale](#scale)
    0. [Contain](#contain)
    0. [Cover](#cover)
    0. [Rotate](#rotate)
    0. [Crop](#crop)
    0. [Blur](#blur)
    0. [Sharpen](#sharpen)
    0. [Mirror](#mirror)
    0. [Flip](#flip)
    0. [Border](#border)
    0. [Pad](#pad)
    0. [Adjust saturation](#saturate)
    0. Adjust lightness: [lighten](#lighten) / [darken](#darken)
    0. [Adjust hue](#hue)
    0. [Fade (adjust transparency)](#fade)
    0. [Opacify](#opacify)
    0. [Paste](#paste)
    0. [Set pixel](#set-pixel)
  0. [Getters](#getters)
    0. [Width](#width)
    0. [Height](#height)
    0. [Pixel](#get-pixel)
    0. [Clone](#clone)
    0. [Extract / Copy](#extract)
    0. [Get as a Buffer](#get-as-a-buffer)
      0. [JPEG](#jpeg)
      0. [PNG](#png)
      0. [GIF](#gif)
    0. [Write to file](#write-to-file)
  0. [Batch operations](#batch-operations)
0. [Copyrights](#copyrights)

## Overview

This module provides comprehensive, fast, and simple image processing and
manipulation capabilities.

**There are no external runtime dependencies**, which means you don't have to
install anything else on your system.

**This module is in active development. [New features](https://github.com/EyalAr/lwip/issues?labels=feature+request&page=1&state=open) are being added.**

[Read the background for the development of this module.](http://eyalarubas.com/image-processing-nodejs.html)

### Installation

`npm install lwip`

Or, clone this repo and `cd lwip && npm install`.

You can run tests with `npm test`.

**Note:** Installation of this module involves compiling native code.
If `npm install lwip` failes, you probably need to setup your system.
[See instructions](https://github.com/TooTallNate/node-gyp#installation).

### Usage

**Typical workflow:**

0. Open an image and get an image object.
0. Manipulate it.
0. Save to disk / Send image buffer over network / etc.

**Example (batch operations):**

```Javascript
// obtain an image object:
require('lwip').open('image.jpg', function(err, image){

  // check err...
  // define a batch of manipulations and save to disk as JPEG:
  image.batch()
    .scale(0.75)          // scale to 75%
    .rotate(45, 'white')  // rotate 45degs clockwise (white fill)
    .crop(200, 200)       // crop a 200X200 square from center
    .blur(5)              // Gaussian blur with SD=5
    .writeFile('output.jpg', function(err){
      // check err...
      // done.
    });
<commit_msg>note in readme minimal version of visual studio<commit_after>[![Version](http://img.shields.io/npm/v/lwip.svg)](https://www.npmjs.org/package/lwip)
[![Build Status](https://api.travis-ci.org/EyalAr/lwip.svg?branch=master)](https://travis-ci.org/EyalAr/lwip)
[![Coverage Status](https://img.shields.io/coveralls/EyalAr/lwip/master.svg)](https://coveralls.io/r/EyalAr/lwip)

# Light-weight image processor for NodeJS

0. [Overview](#overview)
  0. [Installation](#installation)
  0. [Usage](#usage)
  0. [Supported formats](#supported-formats)
  0. [Colors specification](#colors-specification)
  0. [Note on transparent images](#note-on-transparent-images)
0. [API](#api)
  0. [Open an image from file or buffer](#open-an-image)
  0. [Create a new blank image](#create-a-new-image)
  0. [Image operations](#image-operations)
    0. [Resize](#resize)
    0. [Scale](#scale)
    0. [Contain](#contain)
    0. [Cover](#cover)
    0. [Rotate](#rotate)
    0. [Crop](#crop)
    0. [Blur](#blur)
    0. [Sharpen](#sharpen)
    0. [Mirror](#mirror)
    0. [Flip](#flip)
    0. [Border](#border)
    0. [Pad](#pad)
    0. [Adjust saturation](#saturate)
    0. Adjust lightness: [lighten](#lighten) / [darken](#darken)
    0. [Adjust hue](#hue)
    0. [Fade (adjust transparency)](#fade)
    0. [Opacify](#opacify)
    0. [Paste](#paste)
    0. [Set pixel](#set-pixel)
  0. [Getters](#getters)
    0. [Width](#width)
    0. [Height](#height)
    0. [Pixel](#get-pixel)
    0. [Clone](#clone)
    0. [Extract / Copy](#extract)
    0. [Get as a Buffer](#get-as-a-buffer)
      0. [JPEG](#jpeg)
      0. [PNG](#png)
      0. [GIF](#gif)
    0. [Write to file](#write-to-file)
  0. [Batch operations](#batch-operations)
0. [Copyrights](#copyrights)

## Overview

This module provides comprehensive, fast, and simple image processing and
manipulation capabilities.

**There are no external runtime dependencies**, which means you don't have to
install anything else on your system.

**This module is in active development. [New features](https://github.com/EyalAr/lwip/issues?labels=feature+request&page=1&state=open) are being added.**

[Read the background for the development of this module.](http://eyalarubas.com/image-processing-nodejs.html)

### Installation

`npm install lwip`

Or, clone this repo and `cd lwip && npm install`.

You can run tests with `npm test`.

**Note:** Installation of this module involves compiling native code.
If `npm install lwip` failes, you probably need to setup your system.
[See instructions](https://github.com/TooTallNate/node-gyp#installation).
Building on Windows with Visual Studio requires version 2013 or higher.

### Usage

**Typical workflow:**

0. Open an image and get an image object.
0. Manipulate it.
0. Save to disk / Send image buffer over network / etc.

**Example (batch operations):**

```Javascript
// obtain an image object:
require('lwip').open('image.jpg', function(err, image){

  // check err...
  // define a batch of manipulations and save to disk as JPEG:
  image.batch()
    .scale(0.75)          // scale to 75%
    .rotate(45, 'white')  // rotate 45degs clockwise (white fill)
    .crop(200, 200)       // crop a 200X200 square from center
    .blur(5)              // Gaussian blur with SD=5
    .writeFile('output.jpg', function(err){
      // check err...
      // done.
    });

{'fraction_non_alphanumeric': 0.1684931506849315, 'fraction_numerical': 0.02161339421613394, 'mean_word_length': 3.4579375848032563, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6138739', 'n_tokens_mistral': 2405, 'n_tokens_neox': 2219, 'n_words': 614}