API Reference
BMPImages.BMPImages — ModuleBMPImages provides the I/O support for Windows Bitmap (*.bmp) files.
APIs
BMPImages.BMPImageHeader — TypeBMPImageHeaderA 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}BMPImages.Compression — TypeBMPImages.Compression{id}A singleton type for compression mode.
Defined instances
BI_RGBBI_RLE8BI_RLE4BI_BITFIELDSBI_JPEGBI_PNG
BMPImages.XYZTriple — TypeBMPImages.XYZTripleA type for RGB color primaries.
Fields
red :: XYZq1f30
green :: XYZq1f30
blue :: XYZq1f30BMPImages.XYZq1f30 — TypeBMPImages.XYZq1f30 <: Color3{Q1f30}XYZ color type with component type Q1f30.
Fields
x :: Q1f30
y :: Q1f30
z :: Q1f30Examples
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)BMPImages.add_bmp_format — Functionadd_bmp_format()Register format"BMP" to FileIO specifying BMPImages as the primary provider of the loader/saver.
This function forcefully rewrites the internal registry of FileIO.
BMPImages.read_bmp — Methodread_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}}: defaultMatrix{Gray{N0f8}}: for 4-bit or 8-bit indexed grayscale imagesMatrix{Gray{Bool}}: for binary grayscale (black and white) images
BMPImages.read_bmp_header — Methodread_bmp_header(filepath::AbstractString) -> BMPImageHeader
read_bmp_header(io::IO) -> BMPImageHeaderRead the BMP image header from the specified file or IO object.
BMPImages.write_bmp — Methodwrite_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 inchexpand_paletted::Bool: Iftrue, the color table is not used regardless of the number of colors used. Default tofalse.