{"action":"created","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/1604","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1604/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1604/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1604/events","html_url":"https://github.com/python-pillow/Pillow/issues/1604","id":123265898,"number":1604,"title":"Resizing may result in degraded quality because gamma is not compensated","user":{"login":"znerol","id":23288,"avatar_url":"https://avatars.githubusercontent.com/u/23288?v=3","gravatar_id":"","url":"https://api.github.com/users/znerol","html_url":"https://github.com/znerol","followers_url":"https://api.github.com/users/znerol/followers","following_url":"https://api.github.com/users/znerol/following{/other_user}","gists_url":"https://api.github.com/users/znerol/gists{/gist_id}","starred_url":"https://api.github.com/users/znerol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znerol/subscriptions","organizations_url":"https://api.github.com/users/znerol/orgs","repos_url":"https://api.github.com/users/znerol/repos","events_url":"https://api.github.com/users/znerol/events{/privacy}","received_events_url":"https://api.github.com/users/znerol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-21T12:04:11Z","updated_at":"2015-12-21T12:51:22Z","closed_at":null,"body":"Citing from http://www.4p8.com/eric.brasseur/gamma.html\r\n\r\n> Technically speaking, the problem is that \"the computations are performed as if the scale of brightnesses was linear while in fact it is a power scale.\" In mathematical terms: \"a gamma of 1.0 is assumed while it is 2.2.\" Lots of filters, plug-ins and scripts make the same error.\r\n\r\nPillow seems to be affected by that problem too as the following test script demonstrates:\r\n\r\n```python\r\nfrom PIL import Image\r\nfrom cStringIO import StringIO\r\nfrom urllib2 import urlopen\r\n\r\nf = urlopen('http://www.4p8.com/eric.brasseur/gamma_dalai_lama_gray.jpg')\r\nimg = Image.open(StringIO(f.read()))\r\nimg.show()\r\n\r\nnewsize = tuple([i/2 for i in img.size])\r\nimgscaled = img.resize(newsize, Image.ANTIALIAS)\r\nimgscaled.show()\r\n```"},"comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments/166297340","html_url":"https://github.com/python-pillow/Pillow/issues/1604#issuecomment-166297340","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1604","id":166297340,"user":{"login":"znerol","id":23288,"avatar_url":"https://avatars.githubusercontent.com/u/23288?v=3","gravatar_id":"","url":"https://api.github.com/users/znerol","html_url":"https://github.com/znerol","followers_url":"https://api.github.com/users/znerol/followers","following_url":"https://api.github.com/users/znerol/following{/other_user}","gists_url":"https://api.github.com/users/znerol/gists{/gist_id}","starred_url":"https://api.github.com/users/znerol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znerol/subscriptions","organizations_url":"https://api.github.com/users/znerol/orgs","repos_url":"https://api.github.com/users/znerol/repos","events_url":"https://api.github.com/users/znerol/events{/privacy}","received_events_url":"https://api.github.com/users/znerol/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T12:51:22Z","updated_at":"2015-12-21T12:51:22Z","body":"There is an [SO question](http://stackoverflow.com/q/31300865/2779045) providing a workaround using numpy."}}