Hello,
What is format and alignment of data (PixelPacket ) accessed by AcquireImagePixels? I have some problems with transparency using buffer returned by AcquireImagePixels. Areas with transparent color is black. (Q==8)
regards,
PixelPacket color format
Re: PixelPacket color format
The PixelPacket structure is defined in magick/pixel.h and is defined as follows:
Where Quantum is unsigned char for the Q8 version of ImageMagick.
Code: Select all
typedef struct _PixelPacket
{
#if defined(MAGICKCORE_WORDS_BIGENDIAN)
Quantum
red,
green,
blue,
opacity;
#else
Quantum
blue,
green,
red,
opacity;
#endif
} PixelPacket;
Re: PixelPacket color format
Is it possible to change order of pixelpacket components? It is necessary to use buffer in third-party software without making conversion.
Is it possible to make opacity as 255-opacity (255 means maximum component value)?
Is it possible to make opacity as 255-opacity (255 means maximum component value)?
Re: PixelPacket color format
The pixel component order does not matter to ImageMagick. Change it in the header and compile / install. Unfortunately the only way to get / set alpha is with (QuantumRange - opacity).