datamosh icon indicating copy to clipboard operation
datamosh copied to clipboard

Feature: New modes

Open mster opened this issue 5 years ago • 1 comments

Want to work with buffers to create some fun images?

Consider adding a mode to Datamosh!

Work

By adding a new mode, you will be creating a new file which exports a function that manipulates data extracted from a source image's bitmap. That may sound like a lot, but it'll essentially come down to basic iteration over a buffer. Starter code has been provided here.

Your mosh mode doesn't have to do anything specific -- if you think it's cool, we probably will too. Use your imagination and feel free to experiment!

Most of Datamosh's current modes overwrite existing Red/Green/Blue (RGB) pixel values with something random. If you get stuck check out some examples.

To test your mode, you have two options:

  1. (Preferred) Import it into Datamosh by adding an entery in mosh.MODES, here.
  2. Add it to the function property after you initialize Datamosh. Example code on how to do this can be found here.

On Contributing

There aren't many hoops to jump though.

Datamosh uses Prettier for linting and formatting. You will be approved for merging as long as your code passes npm test and only modifies what is needed for your contribution.

You can learn more about contributing in our Contributing document.

Contributing

mster avatar Jul 09 '20 20:07 mster

NOTE: This issue will remain open. Multiple contributors may add modes.

Don't worry if someone has already started working on their own mode.

mster avatar Jul 10 '20 02:07 mster