2017-12-22 17:22:08 +00:00
# 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
2018-01-26 18:38:22 +00:00
to **Adam Le Doux** for creating the wonderful and inspiring Bitsy
2017-12-22 17:22:08 +00:00
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
2017-12-27 17:38:13 +00:00
Forks and pull requests welcome!
2018-04-01 17:02:54 +00:00
The stylesheet and html are auto-generated; if you want to alter them please edit the pug template or less stylesheet, then either run the included `build.sh` script or build from the command line as follows:
2017-12-22 17:22:08 +00:00
`pug index.pug index.html`
2017-12-23 15:54:19 +00:00
2017-12-22 17:22:08 +00:00
`lessc style.less style.css`
`pug` and `less` can be installed via `npm` as follows:
`npm install -g pug-cli`
2017-12-23 15:54:19 +00:00
2017-12-22 17:22:08 +00:00
`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:
```
2018-01-26 18:38:22 +00:00
// croppie.js:182 (original)
2017-12-22 17:22:08 +00:00
if (src.match(/^(https)?:\/\/|^\/\//)) {
2018-01-26 18:38:22 +00:00
// croppie.js:182 (mine)
2017-12-22 17:22:08 +00:00
if (src.match(/^(file|https)?:\/\/|^\/\//)) {
```
2018-02-24 21:52:54 +00:00
## bugs
* does not work on ipad (can't scroll to the right?)
2018-03-03 12:00:50 +00:00
* possibly fixed; needs testing
2018-03-03 23:51:46 +00:00
* create tiles slider breaks onto 2 lines in some browsers?
2018-04-01 17:02:54 +00:00
* sometimes overwrites existing rooms?
2018-02-24 21:52:54 +00:00
2017-12-22 17:22:08 +00:00
## to do
2018-05-08 20:31:37 +00:00
* test new room ID handling!!!
2018-05-12 23:29:51 +00:00
* don't reuse wall tiles
2018-02-28 08:40:26 +00:00
* add 'clear'/'upload' buttons for game data
* select all on clicking game data entry field
2017-12-29 15:49:18 +00:00
* allow user to save output as image, or tweet it :)
* *user can currently right-click -> Save As but the 128x128 size is not great*
2017-12-27 17:38:13 +00:00
* animate animated tiles
2017-12-23 15:54:19 +00:00
* profile script performance and optimise where most needed
2017-12-23 16:46:15 +00:00
* make brightness slider trigger redraw every so often while being dragged, instead of waiting until drag stop
2018-02-24 21:52:54 +00:00
* add up/down arrows to the brightness slider for incremental tweaks
2018-02-28 08:40:26 +00:00
* add 'all-white' tile by default in case the game data doesn't have it?
2018-03-03 12:21:42 +00:00
* handle arbitrary animation frames (editor only supports 2 frames, but game data has no upper limit)
2018-03-03 23:51:46 +00:00
* list how many new tiles are being created
* combine preview and output
2018-03-04 08:35:13 +00:00
* give warning on duplicate room names?
* loading spinner on rendering?
* make brightness slider exponential
2019-03-28 12:54:46 +00:00
* rotation options for image
2017-12-22 17:22:08 +00:00
## could do
2018-02-28 08:40:26 +00:00
* add some alternate default tiles - something more useful e.g. dithered tiles, gradients
2017-12-22 17:22:08 +00:00
* add dithering options
* add camera support so users can take a pic instead of uploading an image
2017-12-22 19:46:27 +00:00
* add a 'smoothing' stage to remove errant pixels
* allow user to add palettes to game data
2017-12-23 16:15:07 +00:00
* allow user to draw to canvas
2017-12-24 11:16:26 +00:00
* do a 'branching tree' approach to finding the closest tile? i.e. create a 1x1, 2x2, 4x4 version of each tile, so all the broadly darker tiles will sit under '0' and lighter tiles under '1', then tiles that are lighter at the top will sit under '1100', etc... I'm not sure how much more effective this will be or whatever it will give better/faster results but it's worth a try
* give heavier weighting to edge pixels when finding a matching tile? (thanks Mark)
2017-12-29 15:49:18 +00:00
* apply grid lines to preview
* optionally add inverted versions of existing tiles if they are a better match
* make new tiles out of fragments of existing tiles instead of directly copying from bitmap
* allow user to zoom out so the image is letterboxed/windowboxed/etc.
2018-02-24 21:52:54 +00:00
* break up rendering into separate preview and output modes (would be good to have a throttled preview for brightness slider adjustments and then a debounced tile render)
2018-02-28 08:40:26 +00:00
* add 'invert' function
2019-03-26 08:38:51 +00:00
* allow for image colour hack
* make a tool for batch importing images?