imshow
imshow(img)
Input: img · Output: no output
What it is
img is an Image value (e.g. from load_image/grayscale/any transform below), of any size. Places it inline in the current plot panel as a native SVG <image> element at its own resolution. Takes an actual Image, not a scalar matrix — use imagesc for that.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
imshow(img) | img Image, scalar, or matrixnot documented yet | no output | from load_image/grayscale/any transform below), of any size. Places it inline in the current plot panel as a native SVG <image> element at its own resolution. Takes an actual Image, not a scalar matrix — use imagesc for that. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
img = load_image("sample.bmp")
rotated = imrotate(img, 45, method="bilinear", bbox="loose")
imshow(rotated)
from images
m = [10, 200; 50, 220]
img = image_from_matrix(m)
mask = threshold(img, 128)
imshow(mask)
print(mask.width, mask.height) # 2 2
2 2
from images
img = load_image("sample.bmp")
edges = edge_detect(grayscale(img))
imshow(edges)
from images
img = load_image("sample.bmp")
# Rotate 30 degrees about the origin, then shift right/down by (50, 20).
M = affine_translate(50, 20) * affine_rotate(30)
out = imwarp(img, M, method="bilinear", bbox="loose", fill=255)
imshow(out)
from images
How it works
imshow(img) — places a real Value::Image (actual loaded/ processed RGB pixels, not a colormap-mapped scalar grid — that's imagesc's job) inline in a plot, via a single native SVG <image> element (see plotting::image_ops).
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.