tony-pizza / Stereogram.js

Generate stereogram images (popularized as "Magic Eye") in the browser

Home Page:https://tony-pizza.github.io/Stereogram.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Downloading images?

lexiross opened this issue · comments

I want to use this library to programmatically generate thousands of magic eye images with digits or words on them for the purpose of building a classifier. It looks like I need to be in a browser context for the library to work. Is there a way I can skip the tag and write the images directly to disk via a node script? Happy to work on a PR for this, but I'm not sure where I'd start :) Thanks!

You're right -- it would need a little work to be able to run outside of a browser.

The guts that actually convert depth data into magic eye pixel data are not dependent on any browser stuff, and you should be able to easily pass the resultant pixel data from that into some JS image encoder (like this one maybe?).

The more challenging part might be generating the initial depth data without a browser. The code I have that converts images and text into depth data both rely on HTML Canvas. The "template" depth mapper does not rely on Canvas however, so maybe that could work.

Hope that's helpful!

@peeinears thanks so much! I will give it some thought - definitely seems doable

Hey @peeinears, I submitted a PR for this a couple weeks ago - #16 - just wanted to bump it and see if you had a chance to take a look! :)