API Reference

BMPImages.BMPImageHeaderType
BMPImageHeader

A mutable struct that holds the file header, information header, and color table for a bitmap.

The order and type of fields roughly follow the original specifications.

For details, see the document provided by Microsoft

Fields

signature :: UInt16
filesize :: UInt32
offset :: UInt32
headersize :: UInt32
width :: Int32
height :: Int32
planes :: UInt16
bitcount :: UInt16
compression :: BMPImages.Compression
imagesize :: UInt32
xppm :: Int32
yppm :: Int32
colors_used :: UInt32
colors_important :: UInt32
red_mask :: UInt32
green_mask :: UInt32
blue_mask :: UInt32
alpha_mask :: UInt32
colorspace :: UInt32
endpoints :: XYZTriple
gamma_red :: Q15f16
gamma_green :: Q15f16
gamma_blue :: Q15f16
intent :: UInt32
profile_offset :: UInt32
profile_size :: UInt32
colortable :: Vector{<:Colorant}
profile :: Vector{UInt8}
source
BMPImages.CompressionType
BMPImages.Compression{id}

A singleton type for compression mode.

Defined instances

  • BI_RGB
  • BI_RLE8
  • BI_RLE4
  • BI_BITFIELDS
  • BI_JPEG
  • BI_PNG
source
BMPImages.XYZTripleType
BMPImages.XYZTriple

A type for RGB color primaries.

Fields

red :: XYZq1f30
green :: XYZq1f30
blue :: XYZq1f30
source
BMPImages.XYZq1f30Type
BMPImages.XYZq1f30 <: Color3{Q1f30}

XYZ color type with component type Q1f30.

Fields

x :: Q1f30
y :: Q1f30
z :: Q1f30

Examples

julia> using Colors;

julia> d65 = BMPImages.XYZq1f30(0.95047, 1.0, 1.08883)
XYZq1f30(0.9504699996Q1f30,1.0Q1f30,1.0888299998Q1f30)

julia> XYZ(d65.x, d65.y, d65.z)
XYZ{Float32}(0.95047f0,1.0f0,1.08883f0)
source
BMPImages.add_bmp_formatFunction
add_bmp_format()

Register format"BMP" to FileIO specifying BMPImages as the primary provider of the loader/saver.

Warning

This function forcefully rewrites the internal registry of FileIO.

source
BMPImages.read_bmpMethod
read_bmp(filepath::AbstractString; kwargs...)
read_bmp(io::IO; kwargs...)

Read a BMP image from the specified file or IO object.

Keyword arguments

not supported yet

Return types

  • Matrix{RGB{N0f8}}: default
  • Matrix{Gray{N0f8}}: for 4-bit or 8-bit indexed grayscale images
  • Matrix{Gray{Bool}}: for binary grayscale (black and white) images
source
BMPImages.read_bmp_headerMethod
read_bmp_header(filepath::AbstractString) -> BMPImageHeader
read_bmp_header(io::IO) -> BMPImageHeader

Read the BMP image header from the specified file or IO object.

source
BMPImages.write_bmpMethod
write_bmp(filepath::AbstractString, image; kwargs...)
write_bmp(io::IO, image; kwargs...)

Write a image as a BMP image to the specified file or IO object.

Keyword arguments

  • ppi::Real: pixel density in pixels per inch
  • expand_paletted::Bool: If true, the color table is not used regardless of the number of colors used. Default to false.
source