{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/comments/54344026","id":54344026,"diff_hunk":"@@ -1455,3 +1457,37 @@ def _prepare_lab_array(arr):\n     if shape[-1] < 3:\n         raise ValueError('Input array has less than 3 color channels')\n     return dtype.img_as_float(arr, force_copy=True)\n+\n+\n+def img_to_cmap(img, cmap):\n+    \"\"\"Draw a grayscale image by using the given colormap.\n+\n+    Parameters\n+    ----------\n+    img : (M, N) array\n+        The input image.\n+    cmap : string or :class:`matplotlib.colors.Colormap` instance.\n+        The colormap to use\n+\n+    Returns\n+    -------\n+    out: (M, N, 3) array\n+        The image drawn with the specified colormap in RGB format.\n+\n+    Examples\n+    --------\n+    >>> from skimage import data, color\n+    >>> out = color.img_to_cmap(data.camera(), 'afmhot')\n+    \"\"\"\n+\n+    cmap = plt.get_cmap(cmap)\n+    img = img_as_ubyte(img)","path":"skimage/color/colorconv.py","position":39,"original_position":39,"commit_id":"1bc62bd9e71a3c5c2719608ed94c63aa89484348","original_commit_id":"1bc62bd9e71a3c5c2719608ed94c63aa89484348","user":{"login":"jni","id":492549,"avatar_url":"https://avatars.githubusercontent.com/u/492549?v=3","gravatar_id":"","url":"https://api.github.com/users/jni","html_url":"https://github.com/jni","followers_url":"https://api.github.com/users/jni/followers","following_url":"https://api.github.com/users/jni/following{/other_user}","gists_url":"https://api.github.com/users/jni/gists{/gist_id}","starred_url":"https://api.github.com/users/jni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jni/subscriptions","organizations_url":"https://api.github.com/users/jni/orgs","repos_url":"https://api.github.com/users/jni/repos","events_url":"https://api.github.com/users/jni/events{/privacy}","received_events_url":"https://api.github.com/users/jni/received_events","type":"User","site_admin":false},"body":"Is the `img_as_ubyte` conversion really necessary? It would be good for this function to work for non-standard float images.","created_at":"2016-02-28T04:25:01Z","updated_at":"2016-02-28T04:25:01Z","html_url":"https://github.com/scikit-image/scikit-image/pull/1965#discussion_r54344026","pull_request_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1965","_links":{"self":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/comments/54344026"},"html":{"href":"https://github.com/scikit-image/scikit-image/pull/1965#discussion_r54344026"},"pull_request":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1965"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1965","id":60937650,"html_url":"https://github.com/scikit-image/scikit-image/pull/1965","diff_url":"https://github.com/scikit-image/scikit-image/pull/1965.diff","patch_url":"https://github.com/scikit-image/scikit-image/pull/1965.patch","issue_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1965","number":1965,"state":"open","locked":false,"title":"Added img_to_cmap function","user":{"login":"vighneshbirodkar","id":3823490,"avatar_url":"https://avatars.githubusercontent.com/u/3823490?v=3","gravatar_id":"","url":"https://api.github.com/users/vighneshbirodkar","html_url":"https://github.com/vighneshbirodkar","followers_url":"https://api.github.com/users/vighneshbirodkar/followers","following_url":"https://api.github.com/users/vighneshbirodkar/following{/other_user}","gists_url":"https://api.github.com/users/vighneshbirodkar/gists{/gist_id}","starred_url":"https://api.github.com/users/vighneshbirodkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vighneshbirodkar/subscriptions","organizations_url":"https://api.github.com/users/vighneshbirodkar/orgs","repos_url":"https://api.github.com/users/vighneshbirodkar/repos","events_url":"https://api.github.com/users/vighneshbirodkar/events{/privacy}","received_events_url":"https://api.github.com/users/vighneshbirodkar/received_events","type":"User","site_admin":false},"body":"I didn't confirm with the other devs before adding this. I won't mind if this PR is rejected.\r\n\r\n## Example plots\r\n![figure_1](https://cloud.githubusercontent.com/assets/3823490/13371009/697e4d72-dce9-11e5-892d-656facb64894.png)\r\n![figure_2](https://cloud.githubusercontent.com/assets/3823490/13371008/697d2078-dce9-11e5-8769-1e5b2c48b012.png)\r\n","created_at":"2016-02-27T05:31:47Z","updated_at":"2016-02-28T04:25:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"862a6b6e1809d5f82f21704d4567d87ffd7b1b3a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1965/commits","review_comments_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1965/comments","review_comment_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1965/comments","statuses_url":"https://api.github.com/repos/scikit-image/scikit-image/statuses/1bc62bd9e71a3c5c2719608ed94c63aa89484348","head":{"label":"vighneshbirodkar:cmap","ref":"cmap","sha":"1bc62bd9e71a3c5c2719608ed94c63aa89484348","user":{"login":"vighneshbirodkar","id":3823490,"avatar_url":"https://avatars.githubusercontent.com/u/3823490?v=3","gravatar_id":"","url":"https://api.github.com/users/vighneshbirodkar","html_url":"https://github.com/vighneshbirodkar","followers_url":"https://api.github.com/users/vighneshbirodkar/followers","following_url":"https://api.github.com/users/vighneshbirodkar/following{/other_user}","gists_url":"https://api.github.com/users/vighneshbirodkar/gists{/gist_id}","starred_url":"https://api.github.com/users/vighneshbirodkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vighneshbirodkar/subscriptions","organizations_url":"https://api.github.com/users/vighneshbirodkar/orgs","repos_url":"https://api.github.com/users/vighneshbirodkar/repos","events_url":"https://api.github.com/users/vighneshbirodkar/events{/privacy}","received_events_url":"https://api.github.com/users/vighneshbirodkar/received_events","type":"User","site_admin":false},"repo":{"id":17216229,"name":"scikit-image","full_name":"vighneshbirodkar/scikit-image","owner":{"login":"vighneshbirodkar","id":3823490,"avatar_url":"https://avatars.githubusercontent.com/u/3823490?v=3","gravatar_id":"","url":"https://api.github.com/users/vighneshbirodkar","html_url":"https://github.com/vighneshbirodkar","followers_url":"https://api.github.com/users/vighneshbirodkar/followers","following_url":"https://api.github.com/users/vighneshbirodkar/following{/other_user}","gists_url":"https://api.github.com/users/vighneshbirodkar/gists{/gist_id}","starred_url":"https://api.github.com/users/vighneshbirodkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vighneshbirodkar/subscriptions","organizations_url":"https://api.github.com/users/vighneshbirodkar/orgs","repos_url":"https://api.github.com/users/vighneshbirodkar/repos","events_url":"https://api.github.com/users/vighneshbirodkar/events{/privacy}","received_events_url":"https://api.github.com/users/vighneshbirodkar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vighneshbirodkar/scikit-image","description":"Image Processing SciKit (Toolbox for SciPy)","fork":true,"url":"https://api.github.com/repos/vighneshbirodkar/scikit-image","forks_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/forks","keys_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/teams","hooks_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/hooks","issue_events_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/issues/events{/number}","events_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/events","assignees_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/assignees{/user}","branches_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/branches{/branch}","tags_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/tags","blobs_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/statuses/{sha}","languages_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/languages","stargazers_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/stargazers","contributors_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/contributors","subscribers_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/subscribers","subscription_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/subscription","commits_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/contents/{+path}","compare_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/merges","archive_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/downloads","issues_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/issues{/number}","pulls_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/pulls{/number}","milestones_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/milestones{/number}","notifications_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/labels{/name}","releases_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/releases{/id}","deployments_url":"https://api.github.com/repos/vighneshbirodkar/scikit-image/deployments","created_at":"2014-02-26T16:04:02Z","updated_at":"2016-02-27T03:51:03Z","pushed_at":"2016-02-27T07:47:50Z","git_url":"git://github.com/vighneshbirodkar/scikit-image.git","ssh_url":"git@github.com:vighneshbirodkar/scikit-image.git","clone_url":"https://github.com/vighneshbirodkar/scikit-image.git","svn_url":"https://github.com/vighneshbirodkar/scikit-image","homepage":"http://scikit-image.org","size":40850,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scikit-image:master","ref":"master","sha":"14852f4578da1702734311262d90d3f8c620c37c","user":{"login":"scikit-image","id":897180,"avatar_url":"https://avatars.githubusercontent.com/u/897180?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-image","html_url":"https://github.com/scikit-image","followers_url":"https://api.github.com/users/scikit-image/followers","following_url":"https://api.github.com/users/scikit-image/following{/other_user}","gists_url":"https://api.github.com/users/scikit-image/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-image/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-image/subscriptions","organizations_url":"https://api.github.com/users/scikit-image/orgs","repos_url":"https://api.github.com/users/scikit-image/repos","events_url":"https://api.github.com/users/scikit-image/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-image/received_events","type":"Organization","site_admin":false},"repo":{"id":2014929,"name":"scikit-image","full_name":"scikit-image/scikit-image","owner":{"login":"scikit-image","id":897180,"avatar_url":"https://avatars.githubusercontent.com/u/897180?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-image","html_url":"https://github.com/scikit-image","followers_url":"https://api.github.com/users/scikit-image/followers","following_url":"https://api.github.com/users/scikit-image/following{/other_user}","gists_url":"https://api.github.com/users/scikit-image/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-image/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-image/subscriptions","organizations_url":"https://api.github.com/users/scikit-image/orgs","repos_url":"https://api.github.com/users/scikit-image/repos","events_url":"https://api.github.com/users/scikit-image/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-image/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-image/scikit-image","description":"Image Processing SciKit (Toolbox for SciPy)","fork":false,"url":"https://api.github.com/repos/scikit-image/scikit-image","forks_url":"https://api.github.com/repos/scikit-image/scikit-image/forks","keys_url":"https://api.github.com/repos/scikit-image/scikit-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-image/scikit-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-image/scikit-image/teams","hooks_url":"https://api.github.com/repos/scikit-image/scikit-image/hooks","issue_events_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-image/scikit-image/events","assignees_url":"https://api.github.com/repos/scikit-image/scikit-image/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-image/scikit-image/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-image/scikit-image/tags","blobs_url":"https://api.github.com/repos/scikit-image/scikit-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-image/scikit-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-image/scikit-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-image/scikit-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-image/scikit-image/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-image/scikit-image/languages","stargazers_url":"https://api.github.com/repos/scikit-image/scikit-image/stargazers","contributors_url":"https://api.github.com/repos/scikit-image/scikit-image/contributors","subscribers_url":"https://api.github.com/repos/scikit-image/scikit-image/subscribers","subscription_url":"https://api.github.com/repos/scikit-image/scikit-image/subscription","commits_url":"https://api.github.com/repos/scikit-image/scikit-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-image/scikit-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-image/scikit-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/scikit-image/scikit-image/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-image/scikit-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-image/scikit-image/merges","archive_url":"https://api.github.com/repos/scikit-image/scikit-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-image/scikit-image/downloads","issues_url":"https://api.github.com/repos/scikit-image/scikit-image/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-image/scikit-image/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-image/scikit-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-image/scikit-image/labels{/name}","releases_url":"https://api.github.com/repos/scikit-image/scikit-image/releases{/id}","deployments_url":"https://api.github.com/repos/scikit-image/scikit-image/deployments","created_at":"2011-07-07T22:07:20Z","updated_at":"2016-02-27T04:46:27Z","pushed_at":"2016-02-27T11:41:16Z","git_url":"git://github.com/scikit-image/scikit-image.git","ssh_url":"git@github.com:scikit-image/scikit-image.git","clone_url":"https://github.com/scikit-image/scikit-image.git","svn_url":"https://github.com/scikit-image/scikit-image","homepage":"http://scikit-image.org","size":71560,"stargazers_count":1002,"watchers_count":1002,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":508,"mirror_url":null,"open_issues_count":242,"forks":508,"open_issues":242,"watchers":1002,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1965"},"html":{"href":"https://github.com/scikit-image/scikit-image/pull/1965"},"issue":{"href":"https://api.github.com/repos/scikit-image/scikit-image/issues/1965"},"comments":{"href":"https://api.github.com/repos/scikit-image/scikit-image/issues/1965/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1965/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1965/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-image/scikit-image/statuses/1bc62bd9e71a3c5c2719608ed94c63aa89484348"}}}}