convert -modulate fail sometimes with xpm files

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
cedric
Posts: 1
Joined: 2013-03-19T01:36:12-07:00
Authentication code: 6789

convert -modulate fail sometimes with xpm files

Post by cedric »

With imagemagick v6.8.2 when I try to convert the file below with this command :

Code: Select all

convert test.xpm -modulate 100,100,150 test_out.xpm
things go (quite) I’ve expected. Quite expected because colors are also converted in Hexa 16...

Code: Select all

/* XPM */
static char *test[] = {
"16 16 4 1",
" 	c None",
". c #729FCF",
"+ c #6194CB",
"@ c #3465A4",
"++++++++++++++++",
"++++++++++++++++",
"++++++++++++++++",
"++++++++++++++++",
"................",
"................",
"................",
"................",
"................",
"................",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@",
"                "
};
BUT with a file without color 'none' like the file below
the colors remain the same.

Code: Select all

/* XPM */
static char *test[] = {
"16 16 3 1",
". c #729FCF",
"+ c #6194CB",
"@ c #3465A4",
"++++++++++++++++",
"++++++++++++++++",
"++++++++++++++++",
"++++++++++++++++",
"................",
"................",
"................",
"................",
"................",
"................",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@"
};
converted output:

Code: Select all

/* XPM */
static char *test_out[] = {
/* columns rows colors chars-per-pixel */
"16 16 3 1 ",
"  c #72729F9FCFCF",
". c #61619494CBCB",
"X c #34346565A4A4",
/* pixels */
"................",
"................",
"................",
"................",
"                ",
"                ",
"                ",
"                ",
"                ",
"                ",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX"
};
As you can see, colors have not moved (but converted in Hexa 16)

It’s a bug?

Thanks for your answer,

Sorry for my poor English
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert -modulate fail sometimes with xpm files

Post by anthony »

your IM is a Q16. to get 8 bit color output use -depth 8 before the output filename.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply