📚 Getting started
Introduction
🏠 BGRABitmap is a package designed to modify and create images with transparency. Direct pixel access allows fast image processing. The library has been tested on Windows, Linux and Mac.
How to install
There are various ways to install.
Use Online Package Manager in Lazarus.
Get a fresh installation of Lazarus and BGRABitmap with FPCUpDeluxe.
The source code can be browser on the repository.
Quick start
Include BGRABitmap and BGRABitmapTypes in the uses clause. If you are using LCL types, add also BGRAGraphics unit.
Create TBGRABitmap instances for each image. This class derives from TBGRACustomBitmap.
The CanvasBGRA property of type TBGRACanvas provides a canvas with opacity and antialiasing.
The Canvas2D property of type TBGRACanvas2D provides a canvas with 2d transformation and similar to HTML5.
Here is a nice introduction to BGRABitmap in French.
Pixel formats
TBGRABitmap: sRGB, 8 bit per channel
TGrayscaleMask: linear 8 bit grayscale. It now has drawing functions, so you can prepare a mask in 8 bit per pixel, avoiding to consume memory
TExpandedBitmap: linear RGB, 16 bit per channel. It has more precision than TBGRABitmap and is linear, so that dmLinearBlend and dmDrawWithTransparency are equivalent.
TLinearRGBABitmap: linear RGB, 32 bit per channel (single precision float). It has even more precision. Not really recommended though as it uses a lot of memory.
TWordXYZABitmap: XYZ, 16 bit per channel. Can store any real and reflect color with great precision (see below for remarks about XYZ).
TXYZABitmap: XYZ, 32 bit per channel (single precision float). It has even more precision and also a wider range, so that it can store fluorescent colors and light sources that would otherwise saturate.
More resources
You can read more about BGRABitmap in the wiki. And also you can follow tutorials to learn how to use BGRABitmap.
There is also an image transitions tutorial in French.
Lazarus forum has a category for BGRABitmap. To report bugs, please check issues on GitHub.