@plurid/enhanced-image-in-out
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-0 • Public • Published



License: DEL

Enhanced Image Input/Output

Image with Enhanced Abilities


The enhaced image input/output package provides utility for the enhanced image format .eimg.

Contents

Install

To install the enhaced image input/output package run

npm install @plurid/enhanced-image-io

or

yarn add @plurid/enhanced-image-io

Usage

Import Reader and Writer and use accordingly.

import {
    promises as fs,
} from 'fs';

import {
    // Objects.
    Reader,
    Writer,

    // Interface.
    PartialHeader,
} from '@plurid/enhanced-image-io`;


// Local paths to images.
const jpgImage = '/path/to/jpg/image';
const eimgImage = '/path/to/eimg/image';


const main = async () => {
    // Reading an .eimg and writing the image it enhances to a separate file.
    {
        const reader = new Reader(eimgImage);
        const data = await reader.read();

        // Use the header data.
        console.log('eimg header', data.header);

        const jpgPath = 'eimg.jpg';

        await fs.writeFile(
            jpgPath,
            data.image,
        );
    }

    // Writing an .eimg from a .jpg with a custom header.
    {
        const customHeader: PartialHeader = {
            // ...
            // header data
            // ...
        };

        const image = await fs.readFile(jpgImage);

        const writer = new Writer(
            customHeader,
            image,
        );

        const eimgPath = 'jpg.eimg';
        const result = await writer.write(
            eimgPath,
        );

        if (result) {
            console.log('Enhanced Image written succesfully to', eimgPath);
        } else {
            console.log('Enhanced Image written unsuccesfully.');
        }
    }
}


main();

Features

change the colors of the image

extract and select the image text

Viewing

Enhanced Images can be viewed natively using the viewer application.

Enhanced Images can be viewed in browser using the browser extension:

Depict

Enhanced Image uses plurid's depict services for text extraction. A custom API endpoint can be used, provided it uses GraphQL and implements the schema.

Packages

Version

@plurid/enhanced-image-react • implementation for React

Version

@plurid/enhanced-image-io • input/output operations

Readme

Keywords

Package Sidebar

Install

npm i @plurid/enhanced-image-in-out

Weekly Downloads

0

Version

0.0.0-0

License

SEE LICENSE IN LICENSE

Unpacked Size

22.7 kB

Total Files

15

Last publish

Collaborators

  • ly3xqhl8g9