RGB array to ASE file converter.
Please note the core code was for this package was written in 2012 and was tested with a version of Adobe Illustrator that was available at that time. The author cannot guarantee that it still works properly today.
pnpm add rgb2ase
-
const converter = new Rgb2Ase();
- create a new converter instance -
createAse()
accepts an object with shape{ title: string, data: number[][] }
, and a size (default12
). -
getAse()
(optional) to get the contents of the ASE buffer. -
writeAse()
- writes a new file using thetitle
passed into thequantizeData
method.writeAse
accepts an options object:{ path: string }
).
import Rgb2Ase from 'rgb2ase';
const converter = new Rgb2Ase();
converter.createAse(data, 12)
converter.writeAse({ path: './' });
const ase = converter.getAse();
This runs an example of the code using the data in ./data
, and adding an output file (Mordred.ase
) to the ./example/ase
folder, creating one if it doesn't exist.
cd example
node index.js