justgook/elm-image/1.0.0

NOTE: the latest version is 5.0.0

Image

Decoding

Bytes
-> Maybe
{ width : Int
, height : Int
, data : Image
}

Encoding

encodeBmp : Image -> Bytes

The BMP file format, also known as bitmap image file or device independent bitmap (DIB) file format or simply a bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device (such as a graphics adapter), especially on Microsoft Windows and OS/2 operating systems.

Note: Using BMP 32bit is discouraged due to lack of proper support across browsers

encodePng : Image -> Bytes

Portable Network Graphics (PNG) is a raster-graphics file-format that supports lossless data compression. PNG was developed as an improved, non-patented replacement for Graphics Interchange Format (GIF).

PNG supports palette-based images (with palettes of 24-bit RGB or 32-bit RGBA colors), grayscale images (with or without alpha channel for transparency), and full-color non-palette-based RGB images (with or without alpha channel).

Construct

fromList : Width -> List Int -> Image
fromList2d : List (List Int) -> Image
fromArray : Width -> Array Int -> Image
fromArray2d : Array (Array Int) -> Image
fromBytes : Decoder Image -> Bytes -> Image

Destruct

toList : Image -> List Int
toList2d : Image -> List (List Int)
toArray : Image -> Array Int
toArray2d : Image -> Array (Array Int)

Types

type alias Image =
Image
type alias Width =
Int
type alias Height =
Int