Graphics32

{{Short description|Computer graphics library for Delphi}}

{{Multiple issues|

{{More footnotes|date=January 2025}}

{{third-party|date=January 2025}}

{{Orphan|date=May 2015|att=January 2025}}

}}

{{infobox software

| author = Alex Denisov

| developer = Mattias Andersson, Andre Beckedorf, Christian Budde, Michael Bunk, Michael Hansen, Angus Johnson, Anders Melander, et al.

| name = Graphics32 (GR32)

| screenshot =

| released = {{Start date and age|2000|03|09}}

| latest release version = 3.0

| latest release date = {{Start date and age|2025|03|18}}

| operating system = Windows, Linux, OS X

| repo = {{URL|https://github.com/graphics32/graphics32}}

| programming language = Delphi, Free Pascal, Assembly language

| license = MPL, LGPL + Linking Exception

| website = {{URL|https://github.com/graphics32}}

| genre = Graphics library

}}

Graphics32 is an Open source 2D graphics library for Delphi and Free Pascal optimized for 32-bit pixel formats.

Graphics32 provides fast operations for pixels and graphic primitives and is almost a hundred times faster at per-pixel access and about 50–100 times faster at drawing lines than GDI and GDI+.{{Cite web |title=Graphics32 ThickLines benchmark example |url=https://raw.githubusercontent.com/graphics32/graphics32/refs/heads/master/Examples/Drawing/Thick%20Lines/screenshot.png}} Additionally, it provides alpha blending, anti-aliasing, and 2D vector graphics as well as filters for resampling and transforming bitmaps.

The library makes heavy use of hand-optimized SIMD assembler code in performance hotspots and utilizes [https://johnnysswlab.com/cpu-dispatching-make-your-code-both-portable-and-fast/ CPU dispatching] to automatically chose between several different code paths based on the features supported by the host processor. On processors where no supported assembly implementations are available the library falls back to pure Pascal code.

Features

Some of Graphics32's features include:

  • High-performance bitmap alpha blending (including per-pixel alpha blending).
  • Pixel, line, and polygon anti-aliasing with sub-pixel accuracy (combined with alpha blending).
  • Bitmap resampling with high quality reconstruction filters such as Lanczos, Sinc, Bicubic, and Mitchell to name a few.{{Cite web |title=Graphics32 documentation: Sampling and Rasterization |url=https://graphics32.github.io/Docs/Additional%20Topics/Sampling%20and%20Rasterization.htm}}
  • Flexible super-sampling implementation for maximum sampling quality.
  • Flicker-free image displaying components with optimized double buffering via advanced [http://www.levien.com/libart/uta.html MicroTiles] based repaint optimizer.{{Cite web |title=Graphics32 documentation: Repaint optimizer |url=https://graphics32.github.io/Docs/Additional%20Topics/Repaint%20Optimization.htm}}
  • Polygon- and font rasterizer supporting gradient,{{Cite web |title=Graphics32 documentation: Gradients |url=https://graphics32.github.io/Docs/Additional%20Topics/Color%20Gradients.htm}} solid, and pattern fills.

References

{{Reflist}}