Home

Awesome

ImageIO.jl

FileIO.jl integration for image files

Julia version CI Codecov

FormatExtensionsProviderImplementationComment
JPEG.jpg, .jpegJpegTurbo.jlJulia wrapper of libjpeg-turboBenchmark results against other backends
OpenEXR.exrOpenEXR.jlJulia wrapper of OpenEXR
Portable Bitmap formats.pbm, .pgm, .ppmNetpbm.jlpure Julia
PNG (Portable Network Graphics).pngPNGFiles.jlJulia wrapper of libpngBenchmark vs. ImageMagick & QuartzImageIO
QOI (Quite Okay Image) format.qoiQOI.jlpure Julia
DEC SIXEL (six-pixels) graphics.six, .sixelSixel.jlJulia wrapper of libsixel
TIFF (Tag Image File Format).tiff, .tifTiffImages.jlpure Juliacheck OMETIFF.jl for OMETIFF support
WebP.webpWebP.jlJulia wrapper of libwebp

Installation

Install with Pkg:

pkg> add ImageIO  # Press ']' to enter te Pkg REPL mode

Usage

using FileIO
save("test.png", rand(Gray, 100, 100))
load("test.png")
save("test.ppm", rand(RGB, 100, 100))
load("test.ppm")
save("test.tiff", rand(RGB, 100, 100))
load("test.tiff")

Canonicalization

Some image loaders may return custom AbstractArray types. By default, this package "canonicalizes" the returned type to be either Array or IndirectArray. An exception is for calls like load(filename; mmap=true) where the image data will be "lazily" loaded using memory-mapped IO, in which case the default is to allow the lower-level I/O package to return whatever AbstractArray type it chooses.

You can manually control canonicalization with load(filename; canonicalize=tf) where tf is true or false.

Compatibility

If you're using old Julia versions (VERSION < v"1.3"), a dummy ImageIO version v0.0.1 with no real function will be installed. In this case, you still need to install ImageMagick.jl to make FileIO.save/FileIO.load work.