0.7.7 • Published 3 years ago

abraia v0.7.7

Weekly downloads
21
License
MIT
Repository
github
Last release
3 years ago

Npm Version Build Status Coverage Status Analytics

Abraia API client for Node.js

Node.js client for Abraia services, focus on image video optimization for fashion ecommerce and multichannel marketing.

Get the best image and video quality with the minimal file size.

Installation

Install the API client:

npm install --save abraia

Get your free API key and set the ABRAIA_KEY environment variable every time you start a terminal/console session. On Windows, use set instead of export.

export ABRAIA_KEY=your_api_key

For a persistent configuration use your system options to set your ABRAIA_KEY.

Optimizing images

Using the fluent API, to optimize your images you just need to specify the input and output file name, and the image will be smartly optimized for a web best performance.

const abraia = require('abraia/abraia')

abraia.fromFile('images/lion.jpg').toFile('images/optimized.jpg')

For instance, the previous code significantly reduces the JPEG image file size from 470kB to 264kB using our content-aware compression algorithm.

You can also optimize PNG, GIF and WebP images, or convert them from one format to another just changing the file name extension.

abraia.fromFile('images/jaguar.png').toFile('images/jaguar8.png')
abraia.fromFile('images/jaguar.png').toFile('images/jaguar.jpg')

PNG jaguar PNG8 jaguar JPEG jaguar

This automatically optimizes the PNG image from 45KB to 15.8KB or convert it to JPEG (14.1KB) with a white background replacing the transparent one.

Resizing and cropping images

Moreover, Abraia services implement high quality resize and smart cropping options. You can automatically resize and crop your images just specifying the demanded image size.

abraia.fromFile('images/tiger.jpg')
  .resize({ width: 333, height: 333 })
  .toFile('images/tiger_333x333.jpg')

Resized tiger image Smart cropped tiger

Tiger image smart cropped to a square of 333x333 pixels

For a typical image resizing you just need to specify the width or the height of the final image.

abraia.fromFile('images/tiger.jpg')
  .resize({ height: 333 })
  .toFile('images/tiger_x333.jpg')

Resized tiger image

Tiger image resized to a height of 333 pixels

Editing and branding images

Abraia implements a graphical web editor to work with templates, which enables full image editing automation.

abraia.fromFile('images/tiger.jpg')
  .process({ action: 'test.atn' })
  .toFile('images/tiger_brand.jpg')

Branded tiger image

License

This software is licensed under the MIT License. View the license.

0.7.7

3 years ago

0.7.6

3 years ago

0.7.5

3 years ago

0.7.4

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.15

4 years ago

0.6.14

4 years ago

0.6.13

4 years ago

0.6.12

4 years ago

0.6.11

4 years ago

0.6.10

4 years ago

0.6.9

4 years ago

0.6.8

4 years ago

0.6.7

4 years ago

0.6.6

4 years ago

0.6.5

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.12

5 years ago

0.5.11

5 years ago

0.5.10

5 years ago

0.5.9

5 years ago

0.5.8

5 years ago

0.5.7

5 years ago

0.5.6

5 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.11

5 years ago

0.4.10

5 years ago

0.4.9

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.14

5 years ago

0.3.13

5 years ago

0.3.12

5 years ago

0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

5 years ago

0.3.7

5 years ago

0.3.3

6 years ago

0.3.1

6 years ago

0.2.0

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago