tif bit depth incorrect on 64 bit linux
Posted: 2009-01-06T09:21:53-07:00
I am trying to write out a tiff image with byte pixels (using ImageMagick 6.4.5 on fedora 8 64 bit)
using the code below. However, the output image has float pixels. Am I doing something wrong, or is this a bug?
Thanks.
using the code below. However, the output image has float pixels. Am I doing something wrong, or is this a bug?
Thanks.
Code: Select all
#include <Magick++.h>
using namespace Magick;
int main(int argc, char *argv[])
{
void* buf = 0;
Image imgIn("test.jpg");
buf = new char[imgIn.rows()*imgIn.columns()*3];
imgIn.write(0, 0, imgIn.columns(), imgIn.rows(), "RGB", CharPixel, buf);
Image imgOut;
imgOut.read(imgIn.columns(), imgIn.rows(), "RGB", CharPixel, buf);
imgOut.depth(8);
imgOut.compressType(LZWCompression);
imgOut.endian(LSBEndian);
imgOut.write("out.tif");
}