Page 1 of 1

[Magick++] flop() corrupts glTexture

Posted: 2006-12-13T12:47:43-07:00
by dennis2society
i am using magick++ to load images, add some text-label to the image
and finally loading this image as a texture into an opengl program.
while this worked really fine in linux, i am currently experiencing
the problem that the flop-function corrupts my texture.

this code works great, also with loading the texture:

Code: Select all

Magick::Image texImage("bricks.png");
texImage.strokeWidth(1);
texImage.strokeColor("black");
texImage.draw( Magick::DrawableText(1, 25, "my text") );
//texImage.flop();
texImage.magick("RGB");
texImage.write(&textureBlob);
 
the result looks like this:
Image

but when i flop() the image to have the text in the right orientation
the result looks like this:
Image

what is wrong inside the flop-function? the same code works great in
linux and the resulting image can be written to disk correctly. only the
texture itself seems to be corrupted.
i am confused :?:

Posted: 2006-12-13T13:02:16-07:00
by magick
glTexture may be expecting 8-bit pixels. When you flop() the pixels may be promoted to 16-bits per pixel assuming you are using the Q16 version of ImageMagick. Use the Q8 version or set your image depth back to 8 after you flop() it.

Posted: 2006-12-13T13:13:56-07:00
by dennis2society
thanks.
that did it.
:)