conversion to png will make black pixels transparent
Posted: 2011-02-24T01:26:41-07:00
I convert a very simple xpm to png. The image is a solid black box.
The converted png image only contains a transparent background. Nothing more. The black color becomes transparent.
If i change the color of my box to red, green blue or any other color or even almost pure black like #000001 it will convert fine.
But if the value is black/#000000 it will become transparent.
I see this problem with ImageMagick-6.6.7-5, ImageMagick-6.6.7-9
Problem does not exist in ImageMagick-6.6.4-8
Content in xpm file:
Code: Select all
convert blackbox.xpm blackbox.png
If i change the color of my box to red, green blue or any other color or even almost pure black like #000001 it will convert fine.
But if the value is black/#000000 it will become transparent.
I see this problem with ImageMagick-6.6.7-5, ImageMagick-6.6.7-9
Problem does not exist in ImageMagick-6.6.4-8
Content in xpm file:
Code: Select all
const char *black_box[] = {
/* columns rows colors chars-per-pixel */
"16 16 2 1",
" c None",
"0 c #000000",
// Pixels
" ",
" ",
" ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" 00000000000 ",
" ",
" "};