ImageShow.jl

Inline graphical display of images in Julia graphical environments
Author JuliaImages
Popularity
9 Stars
Updated Last
1 Year Ago
Started In
August 2018

ImageShow

This small package implements image show methods suitable for graphical platforms such as IJulia, VS Code and Juno. It is intended to provide convenient inline presentation of greyscale or color images.

Things that users of ImageShow need to know:

  • Without ImageShow, 2d image AbstractMatrix{<:Colorant} will be encoded and displayed as a SVG image, which is not performant for generic image.
  • Once you load this package, 2d image will be encoded and displayed as a PNG image. To encode the data as PNG image, either ImageIO or ImageMagick should be installed.
  • Advanced anti-aliased reduction is applied if ImageTransformations is loaded.
  • using Images automatically loads ImageShow and ImageTransformations for you.

Functions

This package provides three non-exported functions play/explore and gif to interpret your 3D image or 2d images as either a video sequence or a gif.

  • (Experimental) play/explore are interactive tools; it show images frame by frame as video sequence.
  • gif is non-interactive; it encodes the image as gif.

Feel free to replace gif with play/explore and see how it works:

using ImageShow, TestImages, ImageTransformations

# 3d image
img3d = testimage("mri-stack") |> collect
ImageShow.gif(img3d)

# 2d images
toucan = testimage("toucan") # 150×162 RGBA image
moon = testimage("moon") # 256×256 Gray image
framestack = [toucan, moon];
ImageShow.gif(framestack)

# a do-function version
img = testimage("cameraman")
ImageShow.gif(-π/4:π/64:π/4; fps=10) do θ
    imrotate(img, θ, axes(img))
end

See also mosaic, provided by MosaicViews/ImageCore, for a 2d alternative of gif.

Acknowledgement

The functionality of ImageShow has historically been included in the Images umbrella package.