Skip to content

Node.js module for merging layers of an ORA file for conversion to PNG etc.

Notifications You must be signed in to change notification settings

Granjow/ora-to-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Converts multi-layered OpenRaster .ora files to PNG, JPG, or GIF.

ORA screen

ORA?

OpenRaster files consist of multiple layers, like .psd or .xcf files do. ORA is an open file format and is used by illustration programs like MyPaint, Krita, and others.

API

.oraToImage( oraPath, pngPath, callback )

Callback is a function( err: Object|null ); err is null if no error occurred.

Usage: Direct conversion from ORA to PNG

require( 'ora-to-image' ).oraToImage( 'test.ora', 'merged.png', err => {
    console.log( 'Success: ', !err );
} );

.mergeOra( oraPath, callback )

Callback is a function( err: Object|null, img: lwipImage|null )

Usage: Manual processing of the returned image (The callback function will receive a Batch Image from lwip, which can be used to further process the image.)

require( 'ora-to-image' ).mergeOra( 'test.ora', ( err, img ) => {
    img.writeFile( 'merged.jpg' );
} );

.debug

Set it to true to enable debug log messages.

Usage:

require( 'ora-to-image' ).debug = true

Demo

An example ORA file is available in the package as require( 'ora-to-image' ).samples.screen, so you can run the following command in order to generate the drawing on top:

var oti = require( 'ora-to-image' );
oti.mergeOra( oti.samples.screen, ( err, img ) => {
    img.writeFile( 'oraScreen.jpg' );
} );

About

Node.js module for merging layers of an ORA file for conversion to PNG etc.

Resources

Stars

Watchers

Forks

Packages

No packages published