{"action":"created","issue":{"url":"https://api.github.com/repos/ben-eb/postcss-resemble-image/issues/1","repository_url":"https://api.github.com/repos/ben-eb/postcss-resemble-image","labels_url":"https://api.github.com/repos/ben-eb/postcss-resemble-image/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/ben-eb/postcss-resemble-image/issues/1/comments","events_url":"https://api.github.com/repos/ben-eb/postcss-resemble-image/issues/1/events","html_url":"https://github.com/ben-eb/postcss-resemble-image/issues/1","id":185091092,"number":1,"title":"Node-only?","user":{"login":"bfred-it","id":1402241,"avatar_url":"https://avatars.githubusercontent.com/u/1402241?v=3","gravatar_id":"","url":"https://api.github.com/users/bfred-it","html_url":"https://github.com/bfred-it","followers_url":"https://api.github.com/users/bfred-it/followers","following_url":"https://api.github.com/users/bfred-it/following{/other_user}","gists_url":"https://api.github.com/users/bfred-it/gists{/gist_id}","starred_url":"https://api.github.com/users/bfred-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfred-it/subscriptions","organizations_url":"https://api.github.com/users/bfred-it/orgs","repos_url":"https://api.github.com/users/bfred-it/repos","events_url":"https://api.github.com/users/bfred-it/events{/privacy}","received_events_url":"https://api.github.com/users/bfred-it/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-25T11:35:28Z","updated_at":"2016-10-25T12:47:52Z","closed_at":null,"body":"This is an excellent way to automate this, but I'm wondering if it could use a node-only solution. Having to install non-npm dependencies complicates setup and lengthens CI builds."},"comment":{"url":"https://api.github.com/repos/ben-eb/postcss-resemble-image/issues/comments/256024829","html_url":"https://github.com/ben-eb/postcss-resemble-image/issues/1#issuecomment-256024829","issue_url":"https://api.github.com/repos/ben-eb/postcss-resemble-image/issues/1","id":256024829,"user":{"login":"ben-eb","id":1282980,"avatar_url":"https://avatars.githubusercontent.com/u/1282980?v=3","gravatar_id":"","url":"https://api.github.com/users/ben-eb","html_url":"https://github.com/ben-eb","followers_url":"https://api.github.com/users/ben-eb/followers","following_url":"https://api.github.com/users/ben-eb/following{/other_user}","gists_url":"https://api.github.com/users/ben-eb/gists{/gist_id}","starred_url":"https://api.github.com/users/ben-eb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ben-eb/subscriptions","organizations_url":"https://api.github.com/users/ben-eb/orgs","repos_url":"https://api.github.com/users/ben-eb/repos","events_url":"https://api.github.com/users/ben-eb/events{/privacy}","received_events_url":"https://api.github.com/users/ben-eb/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T12:47:52Z","updated_at":"2016-10-25T12:47:52Z","body":"Sure thing, I would accept a pull request for making this Node only. My main decision to use paper.js was the ease of implementation of this colour average detection; basically the guts of the module are these seven lines;\r\n\r\n```js\r\nconst rect = new paper.Path.Rectangle(\r\n    i,\r\n    0,\r\n    chunk,\r\n    height\r\n);\r\nstops.push(colourStop(raster.getAverageColor(rect).toCSS(true), i));\r\n```\r\n\r\nhttps://github.com/ben-eb/postcss-resemble-image/blob/master/src/resembleImage.js#L54-L60\r\n\r\nSo with this code I could get the module working quickly. I think this is also possible using jimp if the image was cropped into vertical chunks and then averaged using something like https://github.com/bencevans/pixel-average. I'd like to leave this discovery to someone else if they would like to send a pull request, for me this implementation is fast enough; much better than manually using Photoshop!"}}
{"actor":{"display_login":"ben-eb"}}