On Mon, 19 Jul 2010 10:37:48 -0400
[email protected] wrote:
| Hi,
| 
| I want to convert png image to xpm (using convert image.png convert.xpm) 
| but the file has some symbolic color, e.g:
| 
| "1  c gray82",
| 
| I have some problem to show the image on Windows computer (ok with 
| Linux). If I change the symbolic color with the hex value, e.g.:
| 
| "1  c #D1D1D1",
| 
| then everything is ok. I was wondering if it's possible to use an 
| argument with convert to use hex value everytime.
| 
I had this problem a long time ago.

My solution was a shell script that looks up the colors, and replaces
the hex stringa with X window color names.

The scripts for this is part on my old "Anthony's Icon Library"
   http://www.cit.griffith.edu.au/~anthony/icons/

Specifically the script directory in
   http://www.cit.griffith.edu.au/~anthony/icons/support/scripts/Icons.html

And the scripts
    xpm-fix        Fix the X pixmap output from pbmplus (restore color names)
    color_db_mk    Create a reverse color name database (for xpm-fix)

These are also related.
    colorname      find the rgb.txt colorname of a pixel #rrggbb value
    color_lookup   Print the #rrggbb pixel value for a named X window color

The "color_db_mk" creates a small table of hex to color names dealing
with the fact that some hex values has multiple color names in the X11
RGB color table.

The "xpm-fix" uses the table to substitute the hex values with color names.

NOTE this is OLD stuff.  I make no guarantees.


  Anthony Thyssen ( System Programmer )    <[email protected]>
 --------------------------------------------------------------------------
   And so, may Evil beware and may Good dress warmly
   and eat lots of fresh vegetables.   -- Tick, "The Tick"
 --------------------------------------------------------------------------
   Anthony's Castle     http://www.cit.griffith.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to