Setting TrueColor on Grayscale JPEG
Posted: 2012-06-17T03:51:28-07:00
When loading a greyscale image into memory, it is automatically changed into image type to 2 (GrayScale). As I cannot use greyscale JPG's in further processing, I need to keep its original image type 6 (TrueColor). However, I cannot find any working method to do so. Here's what I get when loading a greyscale JPG which originally has a 24 bit depth, but after using ImageMagick is changed to 8 bit depth.
$img = new Imagick();
$img->readImage($source);
$img->setImageType(6);
echo $img->getImageType();
Still outputs 2. Is this a bug or a design choice? If it's a design choice, is there any workaround?
Please note that saving the image to file, also produces an 8 bit depth photo, so it's not just the getImageType() function.
$img = new Imagick();
$img->readImage($source);
$img->setImageType(6);
echo $img->getImageType();
Still outputs 2. Is this a bug or a design choice? If it's a design choice, is there any workaround?
Please note that saving the image to file, also produces an 8 bit depth photo, so it's not just the getImageType() function.