imagineer v0.3.1 Imagineer.Image.PNG.Helpers

Summary

Functions

Given a color format and bit depth, tells us how many bytes are needed to store a pixel

Given a color format, bit depth, and the width of an image, tells us how many bytes are are present per scanline (a row of pixels)

Returns the number of channels for a given color_format. For example, :rgb and :rbg16 have 3 channels: one for Red, Green, and Blue. :rgb_alpha and :rgb_alpha each have 4 channels: one for Red, Green, Blue, and the alpha (transparency) channel

Given a PNG’s color type, returns its color format

Returns a binary consisting of length null (<<0>>) bytes

Functions

bytes_per_pixel(atom, int)

Given a color format and bit depth, tells us how many bytes are needed to store a pixel

bytes_per_row(atom, int, width)

Given a color format, bit depth, and the width of an image, tells us how many bytes are are present per scanline (a row of pixels).

channels_per_pixel(atom)

Returns the number of channels for a given color_format. For example, :rgb and :rbg16 have 3 channels: one for Red, Green, and Blue. :rgb_alpha and :rgb_alpha each have 4 channels: one for Red, Green, Blue, and the alpha (transparency) channel.

color_format(int)

Given a PNG’s color type, returns its color format

null_binary(length)

Returns a binary consisting of length null (<<0>>) bytes