matt-dray / pixeltrix

:space_invader::computer_mouse: R package: make pixel art interactively in a plot window, get a matrix, make a gif
Other
21 stars 0 forks source link

Allow for more than binary pixel values #4

Closed matt-dray closed 2 years ago

matt-dray commented 2 years ago

The simplest form is to provide 0 ('off') and 1 ('on') to the user in the output matrix.

Other states may be desirable. In pixel art, you may be afforded four colours to work with, so you'll need 0, 1, 2, 3 and 4.

If you use the package for something other than pixel art, multiple states could encode different meaning, rather than just colour.

I think the package will always work in the basis of clicking the plot window and won't get as complex as being able to input a value, e.g. on the command line. That means that each click of a pixel should cycle it through the available values, like 0, 1, 2, 0, 1, 2, etc. That might get painful if you have lots of potential values to cycle through. Could warn the user if they want lots of values (>5 or something)?

Regardless, for simplicity I think the output matrix should always be composed of consecutive integer values (starting from 0). It's then up to the user to convert this matrix as they see fit, e.g. mapping different hex colour values to each integer value in the matrix.