@@ -97,7 +32,7 @@
- babl is a dynamic, any to any, pixel format translation library.
+ babl is pixel encoding and color space conversion engine in C.
It allows converting between different methods of storing Features
- - ANSI C without external dependencies, works on win32, linux and mac,
- 32bit and 64bit systems.
- - Stable, small API, with singleton objects returned.
- - Extendable with new formats, color models, components
- and datatypes.
- - Can load color spaces from ICC v2 and v4 profiles containing RGB
- matrix + TRC, or CMYK profiles.
+ - Dynamically extendable with new formats, color models, components and datatypes, and SIMD code paths.
- Reference 64bit floating point conversions for datatypes and color
models, with 32bit floating point reference speed-ups in some places.
- - Self profiling/validating and optimizing, optimizing accuracy and
-performance at runtime when the best performing single or multi-step conversion
-path is chosen.
+ - Runtime profiling/validating and code-path optimizing with persistence of profiling data across runs, with caching of results.
+ - Can load Color Spaces from ICC v2 and v4 profiles containing RGB matrix + TRC and with lcms2 dependency also CMYK profiles.
+ - Uses Unified Alpha conversions for conversions between separate and associate alpha, avoiding loss of color fidelity due to asymptotic behavior when dividing by 0.0 in floating point.
+ - Portable self contained C code working on win32, linux, bsds and mac
+on 32bit and 64bit systems.
+ - Stable, small API, with singleton objects returned.
- GEGL through GeglBuffer provides
- tiled buffers with on disk storage as well as linear buffers with accessor
- functions for efficient data access transparently using babl fishes for
- translation to the desired pixel formats.
+ The pixel data storage in GIMP uses
+GEGL's GeglBuffer which internally stores
+tiles and provides an API for retrieving and storing pixel data with implicit
+conversions using babl formats.
+
Download
@@ -142,9 +75,9 @@
Babl uses git. The main repository is hosted by GNOME.
- It can be browsed online and cloned with:
+ It can be browsed online and cloned with:
-
git clone git://git.gnome.org/babl
+
git clone https://gitlab.gnome.org/GNOME/babl.git/
NEWS
@@ -155,10 +88,16 @@
to the GEGL release.
- For more news see git log.
+ For more detailed changes see git log.
+
+
+
+
Usage
+
Most users of babl do not know they are using babl and it is GIMP itself
+ which uses babl, this is documentation for such uses - and others that might
+ want to use babl for pixel format or color space conversion in other software.
+
-
-
Documentation
When using BablFishes to do your conversions, you request a fish to
convert between two formats, and an optimal fish to babls capability is
provided that you can use to do your conversions. Babl also provides
@@ -171,18 +110,17 @@
When performing further extensions to the vocabulary of babl, the
internal consistency is governed by reference conversions that operate
- on double (64 bit floating point values). The only color model
- created during BablCore bootstrap is RGBA (linear light RGB,
- 0.0 - 1.0, with a linear 0.0 - 1.0 opacity channel) backed by the
- double datatype. Defined similarily to double (64 bit floating point values). Color Spaces can
+ be created from chromaticity coordinates or ICC profiles. The reference
+ color space - to maintain fast and bit-accurate conversions on with
+ sRGB is similar to scRGB using
64bit floating point.
-
If babls conversion isn't fast enough, you can provide
- your own conversion shortcut between two formats. The registered
- shortcut might also be used by babl as an intermediate conversion when
- constructing BablFishes for other conversions.
+
To speed up operations, fast path conversions are used.
+ The registered shortcut might also be used by babl as an intermediate
+conversion when constructing BablFishes for other conversions.
Babl extensions are shared objects. If you have already developed
@@ -190,9 +128,6 @@
not take much time and will speed up babl for other users as well.
-
-
Usage
-
babl_process (babl_fish (source_format, destination_format),
source_buffer, destination_buffer,
@@ -231,6 +166,7 @@
If the existing pixel formats are not sufficient for your conversion
needs, new ones can be created on the fly. The constructor
+ needs, new ones can be created on the fly. The constructor
will provide the prior created one if duplicates are registered.
const Babl *format = babl_format_new (babl_model ("R'G'B'"),
@@ -256,51 +192,7 @@
-->
-
- Color Management
- All pixel formats in babl have a specified color space, if NULL is passed
-as a space constants for (unbounded) linear sRGB data is assumed, data being
-sRGB defines the conversion to and from gray-scale as well as the gamma
- - or Transfer Response Curve, TRC, used for converting between linear and
- non-linear variants of the data.
-
- babl has API for creating a format for a specific space:
-babl_format_with_space("R'G'B' u16", babl_space ("Rec2020")) creates a
-16 bit integer format for the Rec2020 color space. Babl knows internally about
-"sRGB", "Rec2020", "Adobe", "Apple", "ProPhoto", "ACEScg" and "ACES2065-1"
-spaces, as they are defined with constants on their wikipedia pages or similar upstream references.
-
- Additional spaces can be loaded from monitor-class matrix+TRC ICC v2 and
- v4 profiles. Using babl_icc_make_space (see babl.h for details). The space of
- a babl format can also be queried with babl_format_get_space.
-
-
-
- CMYK
-
- CMYK handling is done using babl-spaces created with ICC profiles
-containing CMYK profiles. BablSpaces for these ICC profiles handle color conversions using lcms2 - or if compiled without lcms2 support a naive profile independent fallback.
- When a babl space derived from a CMYK ICC profile is used to instantiate
-RGB formats, the resulting formats are using the default/NULL space for
-primaries and TRCs.
-
- The CMYK formats that use lcms2 for color interchange with the rest of
-babl are the following, which are available for all data types, u8, u16, half
-and float:
-
- - CMYK
- Cyan Magenta Yellow Key, with 0 being white and 1.0 full ink coverage.
- - CMYKA
- as previous, with non-associated alpha channel
- - CaMaYaKaA
- as previous but premultiplied/associated alpha
- - cmyk
- inverted CMYK, where 0.0 is full ink coverage and 1.0 is none
- - cmykA
- as previous, with non-associated alpha channel
- - camayakaA
- as previous but premultiplied/associated alpha
-
-
-
-
-
Vocabulary
-
-
-
Pre-multiplied alpha
-
-
babl stores color information in transparent pre-multiplied or associated
-alpha pixels in floating point formats. With floating point pixel formats
-standard way of handling alpha maintains color information very near fully
-transparent pixels - by introducing a limit: BABL_ALPHA_FLOOR which is
-1/65536.0, and treating all alphas beteen zero and this value as this value we
-maintain color information while the discrepancy in behavior gets concealed by
-quantization in 16bit and 8bit formats.
-
-
For images that already are in a premultiplied format on import, this change
-has no impact on its use for pre-multiplied arithmetic, meaning that
-superluminous colors are still supported, it also opens up to GEGL more widely
-expect premultiplied data in more operations which will become a speedup when
-more filters want to integrate in the layer processing pipeline.
-
-
There is a post on patreon with further details about the implementation.
-
@@ -405,7 +279,7 @@
-
+