{"action":"created","issue":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/160","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/160/comments","events_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/160/events","html_url":"https://github.com/hyperspy/hyperspy/issues/160","id":27336232,"number":160,"title":"Speed of update for stack of images","user":{"login":"pburdet","id":3855190,"avatar_url":"https://avatars.githubusercontent.com/u/3855190?v=3","gravatar_id":"","url":"https://api.github.com/users/pburdet","html_url":"https://github.com/pburdet","followers_url":"https://api.github.com/users/pburdet/followers","following_url":"https://api.github.com/users/pburdet/following{/other_user}","gists_url":"https://api.github.com/users/pburdet/gists{/gist_id}","starred_url":"https://api.github.com/users/pburdet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pburdet/subscriptions","organizations_url":"https://api.github.com/users/pburdet/orgs","repos_url":"https://api.github.com/users/pburdet/repos","events_url":"https://api.github.com/users/pburdet/events{/privacy}","received_events_url":"https://api.github.com/users/pburdet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/enhancement","name":"enhancement","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/10","html_url":"https://github.com/hyperspy/hyperspy/milestones/Wish%20list","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/10/labels","id":936841,"number":10,"title":"Wish list","description":"Feature requests that have not been implemented yet nor we know when they will be implemented.","creator":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars.githubusercontent.com/u/989719?v=3","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":0,"state":"open","created_at":"2015-01-15T14:34:30Z","updated_at":"2015-04-07T12:37:55Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2014-02-11T10:06:17Z","updated_at":"2015-04-17T16:51:55Z","closed_at":null,"body":"#452 implements the speed improvements originally proposed in this issue (See below). However, we keep this issue open just in case someone finds other ways to improve the image update speed as suggested by @vidartf.\r\n\r\nOriginal issue\r\n-----------------\r\n\r\n\r\nWhen plotting a stack of images, the speed of update when changing \"stack elements\" is rather slow. We should implement a \"fast\" display suppressing all options that might slow down, such as color scale, axes, title, index, same contrast for all images (calculate once). In fact just a display of the image. I don't know what will be the gain, but it should help. Should we call it, plot_simple() plot_fast() or should it an option in plot (only for image)?"},"comment":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/comments/94025952","html_url":"https://github.com/hyperspy/hyperspy/issues/160#issuecomment-94025952","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/160","id":94025952,"user":{"login":"vidartf","id":510760,"avatar_url":"https://avatars.githubusercontent.com/u/510760?v=3","gravatar_id":"","url":"https://api.github.com/users/vidartf","html_url":"https://github.com/vidartf","followers_url":"https://api.github.com/users/vidartf/followers","following_url":"https://api.github.com/users/vidartf/following{/other_user}","gists_url":"https://api.github.com/users/vidartf/gists{/gist_id}","starred_url":"https://api.github.com/users/vidartf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vidartf/subscriptions","organizations_url":"https://api.github.com/users/vidartf/orgs","repos_url":"https://api.github.com/users/vidartf/repos","events_url":"https://api.github.com/users/vidartf/events{/privacy}","received_events_url":"https://api.github.com/users/vidartf/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T16:51:55Z","updated_at":"2015-04-17T16:51:55Z","body":"I ran some tests on stacks of 2k x 2k images, and from my profiler output, this is the main areas where time is spent:\r\n* Around half the time was spent in ```hyperspy.drawing.image.optimize_contrast()```. Making sure that ```auto_contrast``` is False on navigation removed that time.\r\n* Close to the other half was spent in ```matplotlib.image._get_unsampled_image()```. Detailed profiling shows most of the time is spent with converting the image into a RGBA byte array via the colormap amongst others. I don't think there is a reasonable way to speed this bit up."}}