How to use the pureimage.encodePNG function in pureimage

To help you get started, we’ve selected a few pureimage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mbchang / dynamics / src / js / demo / js / Demo_minimal.js View on Github external
// let filename = opt.out_folder + '/' + opt.exp_name + '_' + prediction_folder + '_' + opt.batch_name + '_ex' + opt.ex + '_step' + s +'.png'
                let filename = opt.out_folder + '/' + prediction_folder + '_' + opt.batch_name + '_ex' + opt.ex + '_step' + s +'.png'

                // console.log(filename)
                // // console.log(prediction_folder)
                // console.log('outfolder',opt.out_folder)
                // console.log('prediction_folder', prediction_folder)
                // // console.log(opt.out_folder)
                // console.log('exp_name', opt.exp_name)
                // // console.log(opt.batch_name)
                // // console.log(opt.ex)
                // // console.log(s)
                // assert(false)

                // let filename = 'out'+s+'_'+s+'.png'  // TODO! rename
                PImage.encodePNG(demo.render.canvas, fs.createWriteStream(filename), function(err) {
                    console.log("wrote out the png file to "+filename);
                });

            }

            s++;
            if( s < num_steps ){
                if (_isBrowser) {
                    setTimeout( f, 100 );
                } else {
                    setTimeout( f, 0 );
                }
            }
        }
        // setInterval(function(){