Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

waifu2x

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

waifu2x

2x upscaling of images with waifu2x

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
354
decreased by-6.35%
Maintainers
1
Weekly downloads
 
Created
Source

About

This package uses the pre-built Windows x64 binaries from waifu2x-converter-cpp in order to upscale anime-styled images with node.js.

Insall

npm install waifu2x
Upscaling and/or de-noising images
import waifu2x from "waifu2x"

/*Upscale an image. If you specify a directory for the destination, the default name will be originalName2x. 
You can optionally set the noise level (0/1/2/3), scale factor (default 2.0), pngCompression (0-9), and jpgWebpQuality (0-101).*/
waifu2x.upscaleImage("./images/laffey.png", "./images/upscaled/laffey2x.png", {noise: 2, scale: 2.0})

/*Recursively upscales all images in a directory. Set recursion to 1 to also upscale all images in all sub directories
(this is the default), or to 0 to only scale images in that specific folder. You can also optionally specify the 
recursionFormat, which will be the format for all the converted images, and the rename, which will be appended to the
end of all the new filenames (default is 2x).*/
waifu2x.upscaleImages("./images", "./upscaled", {recursion: 1, rename: "2x"})
Waifu2xFormats
export type Waifu2xFormats = 
    | ".bmp"
    | ".dib"
    | ".exr"
    | ".hdr"
    | ".jpe" 
    | ".jpeg" 
    | ".jpg" 
    | ".pbm" 
    | ".pgm" 
    | ".pic" 
    | ".png" 
    | ".pnm" 
    | ".ppm" 
    | ".pxm" 
    | ".ras" 
    | ".sr" 
    | ".tif" 
    | ".tiff" 
    | ".webp" 
Waifu2xOptions
export interface Waifu2XOptions {
    noise?: 0 | 1 | 2 | 3
    scale?: number 
    pngCompression?: number
    jpgWebpQuality?: number
    recursion?: 0 | 1
    recursionFormat?: Waifu2xFormats
    rename?: string
}
Source

laffey.jpg

laffey2x.png

Keywords

FAQs

Package last updated on 25 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc