XPM image files with color names fails
Posted: 2010-07-20T19:16:14-07:00
The XPM coder is miss-handling the realing of XPM images contains actual color names rather than hex values.
For example using a "colortable" image..
http://www.imagemagick.org/Usage/images/colortable.gif
This was converted a long time ago (correctly using NetPBMPlus)
While here is the source XPM image (and a IM converted GIF version)
http://www.cit.griffith.edu.au/~anthony ... rtable.xpm
As you can see in the IM converted XPM the colors "Green" and "Purple" come out wrong.
XPM images are ONLY supposed to use X11 color definitions, but IM is using its complete color database for color name conversion which uses SVG definition for "Green" and "Purple", and as such getting the resulting final image wrong. here is its internal color database definition for these two colors. green rgb(0,128,0) SVG
green rgb(0,255,0) X11 XPM purple rgb(128,0,128) SVG
purple rgb(160,32,240) X11 XPM
XPM coder MUST only use X11 colors for colornames when parsing the XPM image file format.
For example using a "colortable" image..
http://www.imagemagick.org/Usage/images/colortable.gif
This was converted a long time ago (correctly using NetPBMPlus)
While here is the source XPM image (and a IM converted GIF version)
http://www.cit.griffith.edu.au/~anthony ... rtable.xpm
As you can see in the IM converted XPM the colors "Green" and "Purple" come out wrong.
XPM images are ONLY supposed to use X11 color definitions, but IM is using its complete color database for color name conversion which uses SVG definition for "Green" and "Purple", and as such getting the resulting final image wrong. here is its internal color database definition for these two colors.
Code: Select all
convert -list color | grep -i '^green '
green rgb(0,255,0) X11 XPM
Code: Select all
convert -list color | grep -i '^purple '
purple rgb(160,32,240) X11 XPM
XPM coder MUST only use X11 colors for colornames when parsing the XPM image file format.