{"action":"created","issue":{"url":"https://api.github.com/repos/nothings/stb/issues/146","labels_url":"https://api.github.com/repos/nothings/stb/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/nothings/stb/issues/146/comments","events_url":"https://api.github.com/repos/nothings/stb/issues/146/events","html_url":"https://github.com/nothings/stb/pull/146","id":93641764,"number":146,"title":"Added support for 16-bit PSD loading.","user":{"login":"rmitton","id":8029835,"avatar_url":"https://avatars.githubusercontent.com/u/8029835?v=3","gravatar_id":"","url":"https://api.github.com/users/rmitton","html_url":"https://github.com/rmitton","followers_url":"https://api.github.com/users/rmitton/followers","following_url":"https://api.github.com/users/rmitton/following{/other_user}","gists_url":"https://api.github.com/users/rmitton/gists{/gist_id}","starred_url":"https://api.github.com/users/rmitton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmitton/subscriptions","organizations_url":"https://api.github.com/users/rmitton/orgs","repos_url":"https://api.github.com/users/rmitton/repos","events_url":"https://api.github.com/users/rmitton/events{/privacy}","received_events_url":"https://api.github.com/users/rmitton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nothings/stb/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/nothings/stb/labels/stb_image","name":"stb_image","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-07T22:16:58Z","updated_at":"2015-09-13T12:10:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nothings/stb/pulls/146","html_url":"https://github.com/nothings/stb/pull/146","diff_url":"https://github.com/nothings/stb/pull/146.diff","patch_url":"https://github.com/nothings/stb/pull/146.patch"},"body":"This extends the current PSD loader to add support for 16-bit images, by\r\nquantizing them down to 8-bit upon load."},"comment":{"url":"https://api.github.com/repos/nothings/stb/issues/comments/139865777","html_url":"https://github.com/nothings/stb/pull/146#issuecomment-139865777","issue_url":"https://api.github.com/repos/nothings/stb/issues/146","id":139865777,"user":{"login":"nothings","id":7525026,"avatar_url":"https://avatars.githubusercontent.com/u/7525026?v=3","gravatar_id":"","url":"https://api.github.com/users/nothings","html_url":"https://github.com/nothings","followers_url":"https://api.github.com/users/nothings/followers","following_url":"https://api.github.com/users/nothings/following{/other_user}","gists_url":"https://api.github.com/users/nothings/gists{/gist_id}","starred_url":"https://api.github.com/users/nothings/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nothings/subscriptions","organizations_url":"https://api.github.com/users/nothings/orgs","repos_url":"https://api.github.com/users/nothings/repos","events_url":"https://api.github.com/users/nothings/events{/privacy}","received_events_url":"https://api.github.com/users/nothings/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T12:10:04Z","updated_at":"2015-09-13T12:10:04Z","body":"I'm merging this and it'll be in the next version, but:\r\n\r\n1. I changed \"pixel * 255 / 65535\" to \"pixel / 256\". There are three options: (a) create 256 buckets each of which cover 256 of the 16-bit values; (b) create 256 buckets, with the 0 and 255 buckets half-sized (this is seen for float-to-int with rounding); (c) have buckets 0-254 cover 257 16-bit values, and bucket 255 cover 1 16-bit value (this is what your code does). I have chosen (a). Please let me know if I've analyzed this wrong.\r\n\r\n2. It doesn't support RLE-compressed 16-bit data (not sure if it's allowed, the specification is unhelpful)\r\n\r\n3. The full 16-bit values should be exposed through the floating-point-pixel \"HDR\" interface\r\n\r\nIf you have any interest in doing 2 or 3, let me know, otherwise I'll open up new issues for them."}}