Page 1 of 1

Invalid bit depth for RGBA image

Posted: 2010-05-23T06:30:20-07:00
by sutterp
I am trying to use convert to generate menu screens for video dvds. These menu screens should be in png format, indexed, 2 colors (transparent and a foreground) with a size of 720x576. If the image has more than 2 colors or is of different size or is not indexed, the menu will not work when playing the dvd.

This is what I use to generate the image:

Code: Select all

convert -size 720x576 xc:white -transparent white  -depth 2 -font Helvetica-Bold -pointsize 25 -fill red  -draw "text 0,312 'Text for button 1 '" -define png:color-type=indexed -colors 2  out.png
Under SuSE Linux V8.3 with
Version: ImageMagick 6.3.5 06/04/09 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
This produces the expected result, a file named out.png with image dimensions 720x576, indexed-alpha 1 layer.

The same command run under Centos V5.4 with
Version: ImageMagick 6.2.8 04/17/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
This fails with
convert: Invalid bit depth for RGBA image `out.png'.


Why?
How to fix?

Thanks for any hints

Peter

Re: Invalid bit depth for RGBA image

Posted: 2010-05-28T20:01:42-07:00
by fmw42
I suspect v 6.2.8 was too old and probably did not have some feature that was subsequently added later. I expect the only way around this is to upgrade from 6.2.8 to some more current version such as your other one at atleast 6.3.5

Re: Invalid bit depth for RGBA image

Posted: 2010-05-29T18:58:42-07:00
by sutterp
OK, I tried this, unfortunately without success.

I followed the instructions on http://andrewduck.name/2009/01/imagemag ... -centos-5/ to install a newer version of ImageMagick. This was successful but it broke krita and xine-libs. Trying to re-install these results in
Installing for dependencies:
ImageMagick x86_64 6.2.8.0-4.el5_1.1 base 3.3 M
koffice-core x86_64 2:1.6.3-25.20090306svn.el5 epel 1.7 M
koffice-filters x86_64 2:1.6.3-25.20090306svn.el5 epel 2.1 M
koffice-libs x86_64 2:1.6.3-25.20090306svn.el5 epel 4.3 M

which when executed will replace the just compiled ImageMagick. Any workarounds with the existing convert to achieve 2 color indexed images?

Re: Invalid bit depth for RGBA image

Posted: 2010-05-29T19:05:40-07:00
by fmw42
you could try

convert image +dither -colors 2 -depth 2 -type palette resultimage

but I don't know if that will work or not for what you want.

Re: Invalid bit depth for RGBA image

Posted: 2010-06-02T05:59:02-07:00
by Drarakel
If you want only 2 colors, you should turn off antialiasing. Try something like that:

Code: Select all

convert -size 720x576 xc:white -transparent white +antialias -font Helvetica-Bold -pointsize 25 -fill red -draw "text 0,312 'Text for button 1'" -depth 8 -type PaletteMatte out.png
This should work for some older versions of ImageMagick. (With the newest versions, it doesn't work anymore. I either get a 32bit image - or errors.) But I don't have access to v6.2.8, so I don't know how that version behaves..