The fakest of Instagrams, available in your browser at http://grams.dylanpraul.com/
Filters are stored in filters.js
. To add a new filter:
- Add a function to
filters.js
with the new function. The exampleinvertFilter(image, percent)
is provided.- Filter functions take the parameter
image
, which is an instance ofSimpleImage
(seeimage.js
) - Filter functions also take the parameter
percent
, which is the current position of the slider on page - Image size is available as
image.height
andimage.width
image.getPixel(x, y)
returns pixel objects with parametersr
,g
,b
, anda
- Pixels can be set using
image.setPixel(x, y, pixel)
wherepixel
is an object with parametersr
,g
,b
, and optionallya
- Filter functions take the parameter
- Add a new item to the
filters
array, in the form of:{ name: "Filter Name", filter: filterFunction }
- That's it. When you push changes, they will be available at http://grams.dylanpraul.com