{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/48993652","id":48993652,"diff_hunk":"@@ -32,7 +32,7 @@\n \n from matplotlib.cbook import Stack, iterable\n \n-from matplotlib import _image\n+from matplotlib import image as mimage","path":"lib/matplotlib/figure.py","position":5,"original_position":5,"commit_id":"2d42312e358466466e55ac699d39e50ff75f53b8","original_commit_id":"2d42312e358466466e55ac699d39e50ff75f53b8","user":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"body":"eh, people should not be bulk importing from `figure`....right?","created_at":"2016-01-06T18:53:58Z","updated_at":"2016-01-06T18:53:58Z","html_url":"https://github.com/matplotlib/matplotlib/pull/5718#discussion_r48993652","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5718","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/48993652"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/5718#discussion_r48993652"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5718"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5718","id":54403644,"html_url":"https://github.com/matplotlib/matplotlib/pull/5718","diff_url":"https://github.com/matplotlib/matplotlib/pull/5718.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/5718.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5718","number":5718,"state":"open","locked":false,"title":"Rewrite of image infrastructure","user":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"body":"This began as an attempt to fix #5490, but it turned out to be impossible to fix that without addressing a number of other issues.\r\n\r\nThere's a number of things this does.  Let's start with fixing #5490.\r\n\r\nThe order of operations has changed from:\r\n\r\n```\r\nnormalize -> colormap -> resize\r\n```\r\n\r\nto\r\n\r\n```\r\nnormalize -> resize -> colormap\r\n```\r\n\r\nI had experimented with doing the normalization *after* the resize, but Agg is designed for data in range (0, 1).  It might actually be more mathematically/perceptually correct to do the normalization before the resizing (which does linear interpolation modulo some filter) so that if a non-linear norm is being applied, the interpolation takes that into account.\r\n\r\nBEFORE:\r\n\r\n![test](https://cloud.githubusercontent.com/assets/38294/11963100/89fb2432-a8b2-11e5-8e04-5eb54a5b2816.png)\r\n\r\nAFTER:\r\n\r\n![good](https://cloud.githubusercontent.com/assets/38294/11963105/8fea143e-a8b2-11e5-86c0-1961359fe48a.png)\r\n\r\nYou can see the images no longer have the \"red\" that doesn't belong to the color map.\r\n\r\nIn addition:\r\n\r\n- `image.py` was almost completely rewritten.  There was a lot of copy-and-pasted code in there that has now been factored out by having all the image classes inherit from the same base class.\r\n\r\n- Fewer data type conversions are necessary in the image pipeline.  In particular, the resampler can resample RGBA data in floating-point directly, so there's no need to convert it to 8-bit ints and back.\r\n\r\n- The `svg.image_noscale` rcParam is not longer supported.  One can get the same behavior by setting `interpolation=None` on images or `image.interpolation: None` rcParam globally.\r\n\r\n- The experimental feature where one could \"skew\" an image by setting the private member `_image_skew_coordinate` has been removed.  One can set the transform on the image object or its parent Axes to get the same behavior, and this will be understood by other artists as well so I think is much preferred.\r\n\r\n- Non-linear Axis types (log, symlog etc.) are now applied to the images.  It should theoretically be possible to support projections as well, but our projections are currently broken with images for other reasons.  I think I'll implement that as a follow-on to this (since it's not a regression that we don't support arbitrary projections with images).\r\n\r\n- I changed the default of `image.resample` to `True`.  The difference there is `resample: False` *only* applies interpolation when upsampling.  `resample: True` applies it in both directions.  And it has really odd behavior when one dimension is upsampled and the other is downsampled.  I believe the history of this is that `resample: False` is the old behavior before our Agg backend had full-on resampling in it, and the flag was maintained to allow for backward-compatible performance.  I think it's high-time to use the more modern approach by default, especially wrt the upcoming 2.0 release.\r\n\r\n- Formerly, there was image resampling code in both the `_image` extension and the agg backend, apparently so that the Agg backend could apply an affine transform to the image like some of our vector backends.  To reduce the number of complex code paths, the Agg backend has been reverted to being a \"dumb\" backend that can't resize an image and all resampling happens before it hits the backend.  This doesn't break the `interpolation='none'` feature where an exact copy of the original data is stored in a vector file.\r\n\r\n- This revealed a bug in Agg itself when resampling greyscale images, that I plan to report upstream.\r\n\r\n- The `draw_image` backend API has been simplified.  It now simply takes an optional affine transform if the backend can handle transforming the image itself (this is true of all vector backends, and none of the others).\r\n\r\n- A whole slew of C++ code to manage Image buffers has been removed.  This code pre-dated the requirement of Numpy in matplotlib, so it needed to be there just to store the data.  All of this has been replaced with direct usage of Numpy, and a single functional interface to resample images.","created_at":"2015-12-22T19:07:24Z","updated_at":"2016-01-06T18:53:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"affb04aade229b24eccc2c7b856d1aafb7c4cf03","assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/14","html_url":"https://github.com/matplotlib/matplotlib/milestones/next%20major%20release%20(2.0)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/14/labels","id":662004,"number":14,"title":"next major release (2.0)","description":"Style changes only","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":92,"closed_issues":128,"state":"open","created_at":"2014-05-17T14:28:22Z","updated_at":"2016-01-06T04:02:36Z","due_on":"2016-02-01T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5718/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5718/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5718/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/2d42312e358466466e55ac699d39e50ff75f53b8","head":{"label":"mdboom:image-interpolation","ref":"image-interpolation","sha":"2d42312e358466466e55ac699d39e50ff75f53b8","user":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"repo":{"id":1389427,"name":"matplotlib","full_name":"mdboom/matplotlib","owner":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mdboom/matplotlib","description":"","fork":true,"url":"https://api.github.com/repos/mdboom/matplotlib","forks_url":"https://api.github.com/repos/mdboom/matplotlib/forks","keys_url":"https://api.github.com/repos/mdboom/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdboom/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdboom/matplotlib/teams","hooks_url":"https://api.github.com/repos/mdboom/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/mdboom/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/mdboom/matplotlib/events","assignees_url":"https://api.github.com/repos/mdboom/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/mdboom/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/mdboom/matplotlib/tags","blobs_url":"https://api.github.com/repos/mdboom/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdboom/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdboom/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdboom/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdboom/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/mdboom/matplotlib/languages","stargazers_url":"https://api.github.com/repos/mdboom/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/mdboom/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/mdboom/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/mdboom/matplotlib/subscription","commits_url":"https://api.github.com/repos/mdboom/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdboom/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdboom/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdboom/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdboom/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/mdboom/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdboom/matplotlib/merges","archive_url":"https://api.github.com/repos/mdboom/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdboom/matplotlib/downloads","issues_url":"https://api.github.com/repos/mdboom/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/mdboom/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/mdboom/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/mdboom/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdboom/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/mdboom/matplotlib/releases{/id}","created_at":"2011-02-20T15:17:10Z","updated_at":"2015-11-26T15:59:19Z","pushed_at":"2016-01-05T20:08:23Z","git_url":"git://github.com/mdboom/matplotlib.git","ssh_url":"git@github.com:mdboom/matplotlib.git","clone_url":"https://github.com/mdboom/matplotlib.git","svn_url":"https://github.com/mdboom/matplotlib","homepage":"","size":279794,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":7,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"fe701e3756d32f993a1d0e1d3d22176d4ad56a3c","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","created_at":"2011-02-19T03:17:12Z","updated_at":"2016-01-06T14:01:12Z","pushed_at":"2016-01-06T08:36:36Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":333674,"stargazers_count":3148,"watchers_count":3148,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1595,"mirror_url":null,"open_issues_count":783,"forks":1595,"open_issues":783,"watchers":3148,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5718"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/5718"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/5718"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/5718/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5718/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5718/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/2d42312e358466466e55ac699d39e50ff75f53b8"}}}}