{"action":"opened","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":0,"created_at":"2015-12-21T12:04:11Z","updated_at":"2015-12-21T12:04:11Z","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```\r\n    from PIL import Image\r\n    from cStringIO import StringIO\r\n    from urllib2 import urlopen\r\n    \r\n    f = urlopen('http://www.4p8.com/eric.brasseur/gamma_dalai_lama_gray.jpg')\r\n    img = Image.open(StringIO(f.read()))\r\n    img.show()\r\n    \r\n    newsize = tuple([i/2 for i in img.size])\r\n    imgscaled = img.resize(newsize, Image.ANTIALIAS)\r\n    imgscaled.show()\r\n```"}}