On Sunday 15 June 2008, TriKri wrote:
> I am wondering which data type GIMP uses to represent the color in
> a pixel of an image? 8 bits/channel? 12 or 16 bits? float?
The gimop currently works with 8 bit per channel only.
> According to
> there seems to be some different representation types, but glaus is
> somewhat unknown to me, though.
> I’m having a bit of trouble myself deciding which type I should
> have in the program I’m going to make, to use for each channel. If
> I use 8 bits per channel, the different functions will probably run
> a bit faster than if I use floating point values.
In a new program dealin gwith images, you certainly should take a
close look in GEGL - the Generic Graphics Library - which has been
though from the beggining as a library to enable GIMP to work in
other color dephs in a clean way. Most likely, if your program needs
to perform operations in an image you will be fine implementing these
operations in GEGL thenselves, and then havign the remaning of the
program as a UI around the GEGL calls (or even as a GIMP Plug-in if
the users of your programs are likely to do other things with the
images before or after your program do its thing on them)
> If you should, by chance, use floating point representation of the
> colors, is there some function in GIMP to read a jpg image directly
> into an image with floats, instead of using some function already
> existing to read it into an image with 24-bit color and then
> convert it to floating point values?
yes, GEGL can do that for you (but not GIMP).
(ps. http://www.gegl.org/ )
Gimp-developer mailing list