{"action":"opened","issue":{"url":"https://api.github.com/repos/renpy/renpy/issues/1091","repository_url":"https://api.github.com/repos/renpy/renpy","labels_url":"https://api.github.com/repos/renpy/renpy/issues/1091/labels{/name}","comments_url":"https://api.github.com/repos/renpy/renpy/issues/1091/comments","events_url":"https://api.github.com/repos/renpy/renpy/issues/1091/events","html_url":"https://github.com/renpy/renpy/issues/1091","id":194841858,"number":1091,"title":"Request: im.matrix.brightnesscutoff(alpha,invert=False)","user":{"login":"Kuroonehalf","id":12227163,"avatar_url":"https://avatars.githubusercontent.com/u/12227163?v=3","gravatar_id":"","url":"https://api.github.com/users/Kuroonehalf","html_url":"https://github.com/Kuroonehalf","followers_url":"https://api.github.com/users/Kuroonehalf/followers","following_url":"https://api.github.com/users/Kuroonehalf/following{/other_user}","gists_url":"https://api.github.com/users/Kuroonehalf/gists{/gist_id}","starred_url":"https://api.github.com/users/Kuroonehalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kuroonehalf/subscriptions","organizations_url":"https://api.github.com/users/Kuroonehalf/orgs","repos_url":"https://api.github.com/users/Kuroonehalf/repos","events_url":"https://api.github.com/users/Kuroonehalf/events{/privacy}","received_events_url":"https://api.github.com/users/Kuroonehalf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-11T16:48:23Z","updated_at":"2016-12-11T16:48:23Z","closed_at":null,"body":"This function would receive a float argument 'alpha' between 0 and 1, and make any pixel with brightness bellow that number pure white, and any pixel above that pure black.\r\n\r\nInvert would switch the whites and blacks.\r\n\r\nHere's a practical example of the intended behavior.\r\nUsing this as our base image\r\n![gradient](https://cloud.githubusercontent.com/assets/12227163/21081547/42d58e0e-bfc1-11e6-9e05-2dde27fcee0c.jpg)\r\n \r\nIf we did `im.MatrixColor(\"mask.png\", im.matrix.brightnesscutoff(0.5))` we would get:\r\n![cutoff05](https://cloud.githubusercontent.com/assets/12227163/21081510/a826b93c-bfc0-11e6-9287-67e9c395b3e6.jpg)\r\n\r\nAnd `im.MatrixColor(\"mask.png\", im.matrix.brightnesscutoff(0.8))` we'd get:\r\n![cutoff08](https://cloud.githubusercontent.com/assets/12227163/21081541/ff23e5f2-bfc0-11e6-90fe-f280567b7b9a.jpg)\r\n\r\nThis, coupled with im.AlphaMask() should allow devs to do things such as curved health bars, or other progressive cutoff image elements, which is something I've personally been wanting for a while."}}
{"actor":{"display_login":"Kuroonehalf"}}