# bitsy image to room ## about a tool for Bitsy. upload any image and convert it into a room. the room will be added to the game data automatically and you can paste it back into Bitsy. ## thanks to **Adam LeDoux** for creating the wonderful and inspiring Bitsy to **J.P. LeBreton** for creating Playscii which was a huge inspiration for this tool to **Mark Wonnacott** for being relentlessly encouraging and making me want to work even an eighth as hard as them to **Foliotek** for the **Croppie** image plugin ## contributing The stylesheet and html are autogenerated; if you want to alter them please edit the pug template or less stylesheet, e.g. from the command line as follows: `pug index.pug index.html` `lessc style.less style.css` `pug` and `less` can be installed via `npm` as follows: `npm install -g pug-cli` `npm install -g less` I had to hack the included Croppie plugin to allow the user to upload images from their own computer without falling foul of CORS restrictions. So the version bundled here is non-standard. It's a one-line change: ``` croppie.js:182 (original) if (src.match(/^(https)?:\/\/|^\/\//)) { croppie.js:182 (mine) if (src.match(/^(file|https)?:\/\/|^\/\//)) { ``` ## bugs * certain colours cause palette to fail- I think rgb values below 16 result in a single 0-f value instead of being zero-padded * output seems to be offset by 1 tile? check whether iteration is from 0-15 or from 1-16 ## to do * write Bitsy data * create new tiles based on image * only add unique new tiles * implement slider (*always use existing tiles* -> *always create new tiles*) (representing 0-64 threshold for # of common pixels) * move includes to subdirectory * re-style the damn thing * reorganise the page layout for a more logical workflow * handle animated tiles? * profile script performance and optimise where most needed ## could do * add some more palettes? * add some alternate default tiles? something more useful e.g. dithered gradients? * add dithering options * add camera support so users can take a pic instead of uploading an image * add a 'smoothing' stage to remove errant pixels * allow user to add palettes to game data * allow user to draw to canvas