force color PNGs
Posted: 2010-07-06T09:39:37-07:00
Howdy,
First let me say, I've already found and reviewed the posts: Trouble forcing TrueColorMatte and -type command not working
However, I'm still having the same issue where images with no color content are being saved as grayscale. I can use the IM command line tools to force PNGs to save as TrueColor however I'm using a python api for MagickWand. Its my own variation of the project here.
My code is preforming the following steps:
The value of TRUE_COLOR_TYPE is 6, however the value that is printed is 2 for GrayscaleType. Likewise the saved image's colorspace is grayscale as reported by KDE file properties, Krita and - most importantly - ffmpeg which doesn't seem to like grayscale PNG images. Is there something I'm missing here? Thanks.
First let me say, I've already found and reviewed the posts: Trouble forcing TrueColorMatte and -type command not working
However, I'm still having the same issue where images with no color content are being saved as grayscale. I can use the IM command line tools to force PNGs to save as TrueColor however I'm using a python api for MagickWand. Its my own variation of the project here.
My code is preforming the following steps:
Code: Select all
wand=api.NewMagickWand()
api.MagickReadImage(wand, "allGrayImage.png")
api.MagickSetImageFormat(wand, "png24")
api.MagickSetImageDepth(wand, 8)
api.MagickSetImageType(wand, TRUE_COLOR_TYPE)
print api.MagickGetImageType(wand)
api.MagickWriteImage(wand, "pleaseBeColor.png")