{"action":"created","issue":{"url":"https://api.github.com/repos/publiclab/image-sequencer/issues/108","repository_url":"https://api.github.com/repos/publiclab/image-sequencer","labels_url":"https://api.github.com/repos/publiclab/image-sequencer/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/publiclab/image-sequencer/issues/108/comments","events_url":"https://api.github.com/repos/publiclab/image-sequencer/issues/108/events","html_url":"https://github.com/publiclab/image-sequencer/issues/108","id":254867729,"number":108,"title":"Math Module","user":{"login":"ccpandhare","id":20787612,"avatar_url":"https://avatars0.githubusercontent.com/u/20787612?v=4","gravatar_id":"","url":"https://api.github.com/users/ccpandhare","html_url":"https://github.com/ccpandhare","followers_url":"https://api.github.com/users/ccpandhare/followers","following_url":"https://api.github.com/users/ccpandhare/following{/other_user}","gists_url":"https://api.github.com/users/ccpandhare/gists{/gist_id}","starred_url":"https://api.github.com/users/ccpandhare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccpandhare/subscriptions","organizations_url":"https://api.github.com/users/ccpandhare/orgs","repos_url":"https://api.github.com/users/ccpandhare/repos","events_url":"https://api.github.com/users/ccpandhare/events{/privacy}","received_events_url":"https://api.github.com/users/ccpandhare/received_events","type":"User","site_admin":false},"labels":[{"id":676724349,"url":"https://api.github.com/repos/publiclab/image-sequencer/labels/first-timers-only","name":"first-timers-only","color":"ff69b4","default":false},{"id":553129421,"url":"https://api.github.com/repos/publiclab/image-sequencer/labels/help%20wanted","name":"help wanted","color":"ffa500","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-09-03T11:01:50Z","updated_at":"2017-09-03T22:57:40Z","closed_at":null,"author_association":"COLLABORATOR","body":"Hi, this is a first-timers-only issue. This means this has been worked to make it more legible to folks who either **haven't contributed to our codebase before, or even folks who haven't contributed to open source before.**\r\n\r\nIf you have contributed before, consider leaving this one for someone new, and looking through our general [help wanted](https://github.com/publiclab/image-sequencer/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22help%20wanted%22%20) issues. Thanks!\r\n\r\n## The Feature\r\n\r\n**Add a new Image Sequencer Module which accepts a Math expression**\r\n\r\nThis module will iterate over the pixels and for each pixel, manipulate it based on a given Math equation. For example\r\n\r\n```\r\nR = (R + G + B) / (3)\r\nG = (R - G + B)\r\nB = (R + G - B)\r\n```\r\n\r\nThis is inspired from Infragram.org. Have a look at a similar functionality in action on Infragram [here](https://infragram.org/sandbox/).\r\n\r\n## Towards the solution\r\n\r\nHave a look at how to contribute Modules on [./CONTRIBUTING.md](https://github.com/publiclab/image-sequencer/tree/master/CONTRIBUTING.md)\r\n\r\nYou can also have a look at existing modules here : [./src/modules](https://github.com/publiclab/image-sequencer/tree/master/src/modules).\r\n\r\nThere already are modules which do pixel-by-pixel manipulation. For example: [Invert](https://github.com/publiclab/image-sequencer/tree/master/src/modules/Invert), [NdviRed](https://github.com/publiclab/image-sequencer/tree/master/src/modules/NdviRed), [GreenChannel](https://github.com/publiclab/image-sequencer/tree/master/src/modules/GreenChannel).\r\n\r\nThe code for any pixel-by-pixel manipulating module should be almost the same. Each of these have a `changePixel` method. For example, in the [Invert Module](https://github.com/publiclab/image-sequencer/blob/master/src/modules/Invert/Module.js#L22-L24) :\r\n\r\n```js\r\n    function changePixel(r, g, b, a) {\r\n        // r,g,b,a are the channels of the input image.\r\n        // What is being returned is an array of the Red, Green, Blue, Alpha channels of the final image.\r\n        return [255-r, 255-g, 255-b, a];\r\n    }\r\n```\r\n\r\nAn Invert module is supposed to invert the R,G,B values of a given image pixel-by-pixel (i.e. r -> 255-r, and so on). The above changePixel does the same.\r\n\r\nA (function) called pixelManipulation is made for facilitating the easy making of pixel-by-pixel manipulation modules. All the above examples use this.\r\n\r\nThe pixelManipulation function accepts an image, a changePixel function, an output function, image format, etc.\r\n\r\nThe above modules are sufficient to demonstrate its usage.\r\n\r\n## The Solution\r\n\r\n- [ ] Make a new directory in ./src/modules by the name of \"Math\"\r\n- [ ] In this directory, make the files \"info.json\" and \"Module.js\" as prescribed in the [CONTRIBUTING.md](https://github.com/publiclab/image-sequencer/tree/master/CONTRIBUTING.md).\r\n- [ ] Refer to the existing pixel-by-pixel manipulation modules as shown in the section above.\r\n- [ ] Design a changePixel function which takes in equations (For R,G,B) from the user and evaluates the expressions and implement it.\r\n- [ ] List your module in ./src/Modules.js (You won't be able to use it till then)\r\n- [ ] Update the build file by running `$ grunt build`\r\n- [ ] Make sure you didn't break anything by running `$ npm test`\r\n\r\n## Steps to Fix\r\n\r\n- [ ] Claim this issue with a comment here, and ask for any issues/clarifications.\r\n- [ ] Clone this repository locally.\r\n- [ ] Try to fix the issue as described in the \"The Solution\" section above, but even before you have completed doing so, you can:\r\n- [ ] Commit your work and initiate a Pull Request (Mark it as `work-needed` if you haven't completed the work on the issue)"},"comment":{"url":"https://api.github.com/repos/publiclab/image-sequencer/issues/comments/326837055","html_url":"https://github.com/publiclab/image-sequencer/issues/108#issuecomment-326837055","issue_url":"https://api.github.com/repos/publiclab/image-sequencer/issues/108","id":326837055,"user":{"login":"debeshadhikari","id":29619854,"avatar_url":"https://avatars1.githubusercontent.com/u/29619854?v=4","gravatar_id":"","url":"https://api.github.com/users/debeshadhikari","html_url":"https://github.com/debeshadhikari","followers_url":"https://api.github.com/users/debeshadhikari/followers","following_url":"https://api.github.com/users/debeshadhikari/following{/other_user}","gists_url":"https://api.github.com/users/debeshadhikari/gists{/gist_id}","starred_url":"https://api.github.com/users/debeshadhikari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debeshadhikari/subscriptions","organizations_url":"https://api.github.com/users/debeshadhikari/orgs","repos_url":"https://api.github.com/users/debeshadhikari/repos","events_url":"https://api.github.com/users/debeshadhikari/events{/privacy}","received_events_url":"https://api.github.com/users/debeshadhikari/received_events","type":"User","site_admin":false},"created_at":"2017-09-03T22:57:40Z","updated_at":"2017-09-03T22:57:40Z","author_association":"NONE","body":"Sure, thanks ! I will post my questions here if I am stuck. "}}
{"actor":{"display_login":"debeshadhikari"}}