Skip to content

Instantly share code, notes, and snippets.

@hoangsetup
Created June 6, 2021 12:21
Show Gist options
  • Save hoangsetup/f4e5921c27ea7d610e392fa2c5c1bf54 to your computer and use it in GitHub Desktop.
Save hoangsetup/f4e5921c27ea7d610e392fa2c5c1bf54 to your computer and use it in GitHub Desktop.
import * as fs from 'fs';
import * as path from 'path';
import GlassifyLib from './glassifyLib';
(async () => {
const imageBuffer = fs.readFileSync(path.join(__dirname, '../', 'public/images/demo.jpg'));
const output = await GlassifyLib.glassify(imageBuffer);
await fs.writeFileSync(
path.join(__dirname, '../', `public/images/output_${Date.now()}.jpg`),
output,
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment