Forcing to Save RGBA Type Images.
Posted: 2011-03-10T15:19:57-07:00
Dear all,
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:
My question is, how to force imagemagick to save 8Bit RGBA(32-bit) image format regardless of input, please? The above attempt with image.type(TrueColorMatteType); was not apparently helpful.
I use Visual C++, process only .png format, and use 32 bit version of ImageMagick.
Thank you.
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.
Thank you.