I use Imagemagick to prepare textures for my OpenGL ES 2.0 application, which loads the images. The image format supplied to OpenGL ES is supposed to be 8bit RGBA (32-bit).
My problem is, that when I supply Grayscale images(.png/grayscale format) to ImageMagick for processing, the Imagemagick output is a Grayscale image. However, grayscale image can not be loaded by OpenGL ES 2.0.
This is, how I load, process and save .png images:
Code: Select all
// image instance for image to be resized Image my_image; Geometry my_Geometry; // read image my_image.read(imageSource.GetImageFilePath().c_str()); // trim image my_image.trim(); // force RGBA image type my_image.modifyImage(); my_image.type(TrueColorMatteType); my_image.write((_TCHAR*)strngTrimmedFileFullPath.c_str());
I use Visual C++, process only .png format, and use 32 bit version of ImageMagick.