{"action":"created","issue":{"url":"https://api.github.com/repos/crafatar/crafatar/issues/134","labels_url":"https://api.github.com/repos/crafatar/crafatar/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/crafatar/crafatar/issues/134/comments","events_url":"https://api.github.com/repos/crafatar/crafatar/issues/134/events","html_url":"https://github.com/crafatar/crafatar/pull/134","id":97098409,"number":134,"title":"Rewrite renders","user":{"login":"jomo","id":3585743,"avatar_url":"https://avatars.githubusercontent.com/u/3585743?v=3","gravatar_id":"","url":"https://api.github.com/users/jomo","html_url":"https://github.com/jomo","followers_url":"https://api.github.com/users/jomo/followers","following_url":"https://api.github.com/users/jomo/following{/other_user}","gists_url":"https://api.github.com/users/jomo/gists{/gist_id}","starred_url":"https://api.github.com/users/jomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jomo/subscriptions","organizations_url":"https://api.github.com/users/jomo/orgs","repos_url":"https://api.github.com/users/jomo/repos","events_url":"https://api.github.com/users/jomo/events{/privacy}","received_events_url":"https://api.github.com/users/jomo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crafatar/crafatar/labels/3D%20Rendering","name":"3D Rendering","color":"00aaff"},{"url":"https://api.github.com/repos/crafatar/crafatar/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/crafatar/crafatar/labels/in%20progress","name":"in progress","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"jomo","id":3585743,"avatar_url":"https://avatars.githubusercontent.com/u/3585743?v=3","gravatar_id":"","url":"https://api.github.com/users/jomo","html_url":"https://github.com/jomo","followers_url":"https://api.github.com/users/jomo/followers","following_url":"https://api.github.com/users/jomo/following{/other_user}","gists_url":"https://api.github.com/users/jomo/gists{/gist_id}","starred_url":"https://api.github.com/users/jomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jomo/subscriptions","organizations_url":"https://api.github.com/users/jomo/orgs","repos_url":"https://api.github.com/users/jomo/repos","events_url":"https://api.github.com/users/jomo/events{/privacy}","received_events_url":"https://api.github.com/users/jomo/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-07-24T17:32:56Z","updated_at":"2015-09-04T20:30:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/crafatar/crafatar/pulls/134","html_url":"https://github.com/crafatar/crafatar/pull/134","diff_url":"https://github.com/crafatar/crafatar/pull/134.diff","patch_url":"https://github.com/crafatar/crafatar/pull/134.patch"},"body":"This is a WIP pull request that hopefully fixes #32, #112, #117, #125, and makes our renders isometric.\r\n\r\n**Renders are currently not isometric**\r\nBut I think they should be. (?)\r\n![isometric](https://i.imgur.com/64Jy8Lq.png)\r\n\r\n**Each part of the skin will be cut out separately (to a canvas or image)**\r\nThis should fix the problem with neighboring pixels leaking colors, as described in https://github.com/crafatar/crafatar/pull/26#issuecomment-67596276 (which *may* be a bug in node-canvas or cairo)\r\n\r\n**The single parts will then be placed on the rendering canvas**\r\nWe can use `drawImage` and `imageSmoothingEnabled = false` (`patternQuality = \"fast\"` in node-canvas) to resize the parts at the same time.\r\n\r\n**That does't fix the problem with \"cracks\" in the render**\r\nThe issue is that drawing to a [transformed canvas](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform) always uses anti-aliasing and results in (semi-)transparent pixels on edges. This is what all browsers + node-canvas do, so I assume it's correct behavior.\r\n![demo screenshot](https://i.imgur.com/R4bN9wo.png)\r\nClick [here for demo](http://jsbin.com/fimavapezi/1/edit?css,js,output) (doesn't work well in Chrome).\r\n\r\n**Stitching parts together**\r\nThe front side (arms, legs, body) of the render can be stitched together to one image before transforming the canvas, which removes *some* of the \"cracks\" we're having.\r\nWe might have to try merging the anti-aliased edges into each other to avoid the \"cracks\".\r\n\r\n-----\r\n\r\n* *The first commit is just me messing around and it will be mostly replaced, but some of the approaches described above are used.*\r\n* *Please ignore the test failures for now*"},"comment":{"url":"https://api.github.com/repos/crafatar/crafatar/issues/comments/137845758","html_url":"https://github.com/crafatar/crafatar/pull/134#issuecomment-137845758","issue_url":"https://api.github.com/repos/crafatar/crafatar/issues/134","id":137845758,"user":{"login":"jomo","id":3585743,"avatar_url":"https://avatars.githubusercontent.com/u/3585743?v=3","gravatar_id":"","url":"https://api.github.com/users/jomo","html_url":"https://github.com/jomo","followers_url":"https://api.github.com/users/jomo/followers","following_url":"https://api.github.com/users/jomo/following{/other_user}","gists_url":"https://api.github.com/users/jomo/gists{/gist_id}","starred_url":"https://api.github.com/users/jomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jomo/subscriptions","organizations_url":"https://api.github.com/users/jomo/orgs","repos_url":"https://api.github.com/users/jomo/repos","events_url":"https://api.github.com/users/jomo/events{/privacy}","received_events_url":"https://api.github.com/users/jomo/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T20:30:44Z","updated_at":"2015-09-04T20:30:44Z","body":"I just had this stupid idea that turns out to be working [way better](https://imgur.com/a/gWkpe) than expected.\r\nWe can use binary transparency, i.e. pixels are either fully transparent or fully colored.\r\n\r\n![rainbow gif](https://i.imgur.com/dY03rm3.gif)"}}