@4bitlabs/resize-filters
TypeScript icon, indicating that this package has built-in type declarations

1.0.17 • Public • Published

@4bitlabs/resize-filters License NPM Version NPM Downloads

A collection of pixel resize filters for rendering Sierra On-line SCI-engine assets.

Nearest-Neighbor

import { nearestNeighbor } from '@4bitlabs/image';

// scale up the image by 3x both horizontally and vertically
const output = nearestNeighbor([3, 3])(source);

Scale2×

Scale the source ImageData using the Scale2× algorithm.

import { scale2x } from '@4bitlabs/image';

// scale the using the Scale2× algorithm
const output = scale2x(source);

Scale3×

Scale the source ImageData using the Scale3× algorithm.

import { scale3x } from '@4bitlabs/image';

// scale the image using the Scale3× algorithm
const output = scale3x([3, 3])(source);

Scale5×6

A variant of the Scale3× algorithm, but scales each pixel to 5×6 block. This incidentally matches the pixel aspect-ratio of CGA/EGA (1.2) graphics when displayed on modern LCD-displays with a 1∶1 pixel aspect-ratio.

import { scale5x6 } from '@4bitlabs/image';

const output = scale5x6(source);

/@4bitlabs/resize-filters/

    Package Sidebar

    Install

    npm i @4bitlabs/resize-filters

    Weekly Downloads

    81

    Version

    1.0.17

    License

    ISC

    Unpacked Size

    43.5 kB

    Total Files

    39

    Last publish

    Collaborators

    • 32bitkid