Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1.09 KB

README.md

File metadata and controls

35 lines (25 loc) · 1.09 KB

LibPNG

Build Status Build status Coverage Status

LibPNG bindings for reading and writing png files in Julia.

TODO - Windows build is broken!

Installation

Pkg.clone("https://github.com/FugroRoames/LibPNG.jl.git")

Usage

using LibPNG
using ColorTypes

# Write RGB image
pixels = rand(RGB, 10, 10)
writeimage("pixels.png", pixels)
pixels_in = readimage("pixels.png")

# Convert to nchannel × height × width matrix
using ImageCore
pixels_matrix = channelview(pixels_in)
writeimage("pixels_channel.png", pixels_matrix)

The supported png image types are RGB, RGBA, Gray and GrayA as defined in ColorTypes.jl. The expected memory structure for images are nchannel × height × width.