B&W SVG -> PNG results in pseudoclass
Posted: 2010-01-20T15:46:04-07:00
I would really appreciate some help with forcing RGB when converting an SVG file. All work fine by default so long as there is more than just black in the vector. But if only black, the resulting PNG becomes Gray/8 (photoshop) or 8-bit PseudoClass 256c (IM identify). It seems that the Pseudo is the problem – all the color ones show 8-bit DirectClass.
I have:
$imagickImage->setImageFormat(“png32″);
$imagickImage->setImageDepth(8);
and then I have tried adding either:
$imagickImage->setImageType(7); //TrueColor
$imagickImage->setImageColorSpace(1); //RGB
OR
$imagickImage->setImageType imagick::IMGTYPE_TRUECOLOR);
$imagickImage->setImageColorSpace(imagick::COLORSPACE_RGB);
Can you please clarify if it is ColorSpace or Colorspace (or does it not matter) and also whether I should be using the text or numerical values to set the space and type.
Is there something else I should be doing to force RGB and DirectClass so that it won’t automatically convert it to Grayscale. I need the PNGs to be DirectClass so that TCPDF can properly show them, otherwise it messes up the image.
Maybe this is an Imagemagick problem in general (so maybe I should post on a more general board), because from some other reading it sounds like some older versions didn't automatically convert to pseudoclass just because there is no colors present.
Thanks,
Adrian
I have:
$imagickImage->setImageFormat(“png32″);
$imagickImage->setImageDepth(8);
and then I have tried adding either:
$imagickImage->setImageType(7); //TrueColor
$imagickImage->setImageColorSpace(1); //RGB
OR
$imagickImage->setImageType imagick::IMGTYPE_TRUECOLOR);
$imagickImage->setImageColorSpace(imagick::COLORSPACE_RGB);
Can you please clarify if it is ColorSpace or Colorspace (or does it not matter) and also whether I should be using the text or numerical values to set the space and type.
Is there something else I should be doing to force RGB and DirectClass so that it won’t automatically convert it to Grayscale. I need the PNGs to be DirectClass so that TCPDF can properly show them, otherwise it messes up the image.
Maybe this is an Imagemagick problem in general (so maybe I should post on a more general board), because from some other reading it sounds like some older versions didn't automatically convert to pseudoclass just because there is no colors present.
Thanks,
Adrian