-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for Displaying Matrices as Images #9
Comments
Hi,isn't this already covered by Images.jl ? See fonsp/Pluto.jl#60 With Images.jl and Colors.jl you just can do Also what do you mean by "native HTML mode" ? |
I'd like support for images in the representation: So supporting this would be great. By native HTML I meant that the user could chose option to use the The main motivation for this is able to display images in 1:1 (Pixel for pixel) form. |
I guess the image layout depends on row vs column major storage. I think that c x m x n buffer in Julia has the very same memory layout as the n x m x c buffer in numpy due to the fact that Julia is column major and numpy is row major. Native html using the img tag is not planned. And I bet one would have convert anyway to c x m x n to make this work, see above. And I guess that this is what images.jl does anyway. The whole approach here is meant for smoot functions, and I cannot guarantee pixel 1:1. |
I thought the idea is to use JS / HTML for visualization to make things faster (Time to first plot). Regarding the memory layout, I was under the impression the reason is different. Still, the abstraction of image as an The |
Hm ImageShow.jl uses the html tag: But as far as I understand now (my active html knowledge has quite some gaps, I read up on this) this must go throug base64 - which is a big performanc hurt. So I see the possibility to draw the image directly onto canvas, passing binary data via Without any transposition, the core API however would have to be 'c x m x n' because that is the way the data is used in canvas - data for each pixel is stored contiguously: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/putImageData Everything else would have to be copied to fit that layout. So yes in that respect this could fit here. But @fonsp has also some related stuff going on in PlutoUI.jl, this should be coordinated. |
I think the data type is not the important thing here as I can create a small macro or function for my self or even push it later. Later it would be great to be able to show tool tip per pixel (Value of the pixel). |
When hovering is desired, it makes sense to work via plotly.js: https://plotly.com/javascript/reference/image/#image In fact, this appears to make much sense, as the infrastructure for the |
Any chance to add an option to display a matrix or
m x n x c
array as image?With the option to set the display size?
A native HTML mode would be great as well.
The text was updated successfully, but these errors were encountered: