module CrImage::Format::PNG

Overview

Provides methods to read from and write to PNG. Requires libspng to function.

image = File.open("image.png") { |file| CrImage::RGBAImage.from_png(file) }
File.open("other_image.png") { |file| image.to_png(file) }

Alternatively, you can use the convenience methods in the Open and Save modules to acheive the same thing:

image = CrImage::RGBAImage.open("image.png")
image.save("other_image.png")

Direct including types

Defined in:

cr-image/format/png.cr
lib-formats/png.cr

Instance Method Summary

Instance Method Detail

def to_png(io : IO) : Nil #

Output the image as PNG to io


[View source]