@shumai/image

0.0.5 • Public • Published

Shumai Image

A thin wrapper over libvips integrated with Shumai's native tensor type. For use with the Bun runtime.

Install:

$ brew install libvips
$ bun install @shumai/image

Usage:

import * as sm from '@shumai/shumai'
import { Image } from '@shumai/image'

// open images from files
let img = new Image('input.png')

// functional API
img = img.sharpen(2)

// allows chaining
img = img.resize(2).sobel().invert().rotate(14).gaussblur(3)

// convert to Shumai tensor
let t = img.tensor().div(sm.scalar(2))

// manipulate image as a tensor and convert back
t = t.div(sm.scalar(2)).add(sm.scalar(40))
img = new Image(t)

// save the output to file
img.save('output.jpg')

Package Sidebar

Install

npm i @shumai/image

Weekly Downloads

0

Version

0.0.5

License

none

Unpacked Size

11.1 kB

Total Files

6

Last publish

Collaborators

  • shumaiml
  • jacobkahn
  • bwasti