the images are seperated by channel.  man image(6) and draw(3).
a 24-bit image is 1 byte each r, g, b premultiplied by the alpha channel
which is in the fourth byte.

but they are not contiguous in memory, and that is the "usual" way to split an RGB for when you want to manipulate them

surely you'd want to undo the premultiply of the alpha

What are you going to do when you want to move the RGB into HSB or CMYK space ?

The best approach, in my opinion (and it's only that), is to spearate them into channels and then you can have a set of operations that works on combining channels and doesn't care about what that channel is representing.

A bitmap of 8 bit values represents R,G,B,A,H,S,B,C,M,Y and K and any others you come across.

Having them interleaved as RGBA, RGBA, RGBA will give you a headache sooner or later.

Split them up, get them away from a particular image format be it plan9 bitmap, tga or whatever and then you can choose to write out / read in whatever formats you like.

Just my experience of working in broadcast video processing, YMMV.

Matt


Reply via email to