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

ndarray-lanczos

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray-lanczos

Resize an ndarray with Lanczos resampling

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16K
increased by7.28%
Maintainers
1
Weekly downloads
 
Created
Source

ndarray-lanczos

Latest NPM release License Minzipped size CI Coverage

Resize an ndarray with Lanczos resampling.

Quickstart

Installation:

npm install --save ndarray-lanczos

Use:

import ndarray from 'ndarray';
import { getPixels, savePixels } from 'ndarray-pixels';
import { lanczos3 } from 'ndarray-lanczos';

// Read PNG.
const srcPixels = await getPixels('full-size.png');

// Resize with Lanczos 3 resampling.
const dstPixels = ndarray(new Uint8Array(width * height * 4).fill(0), [width, height, 4]);
lanczos3(srcPixels, dstPixels);

// Write PNG.
const data = await savePixels(dstPixels, 'image/png'); // → Uint8Array

Two filtering methods, lanczos3 and lanczos2, are included.

Credits

Thanks to https://github.com/rgba-image/lanczos and https://github.com/nodeca/pica.

FAQs

Package last updated on 24 Feb 2023

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