Page 1 of 1

convert to gif gives black background instead of white

Posted: 2010-02-12T15:12:18-07:00
by Drewby
Along with an OS update (SuSe Linux) ImageMagick was updated to :
Version: ImageMagick 6.5.4-8 2009-10-24 Q16 OpenMP

The problem I face is that when converting to a gif image, the
background is now black, but it used to be white (which is what I want).
The black background means that text and background are the same color
thus can no longer be seperated.

After web-searching and looking through this board, I have tried various
options:
>convert -background white testimage.eps testimage.gif
>convert -fill white testimage.eps testimage.gif
>convert -colorspace RGB testimage.eps testimage.gif
>convert -colorspace RGB -background white testimage.eps testimage.gif

If I convert to a png it works as expected (white background)
>convert testimage.eps testimage.png

but if I try and convert that png to a gif I end up with the same problem.
>convert testimage.png testimage.gif
(i.e. it gives a black background)

Lastly, when I used the below command (which shouldn't add anything?), I
get my desired result, i.e. a white background
>convert -bordercolor white -border 0 testimage.eps testimage.gif


Has anyone run into this issue?
Is this a bug or is there some reason for the black background?

There is no problem when I perform the same convert on a different machine using:
Version: ImageMagick 6.3.6 10/01/08 Q16

Re: convert to gif gives black background instead of white

Posted: 2010-03-15T10:01:05-07:00
by fmw42
perhaps your eps has transparency.

Try

convert image.eps -background white -flatten image.gif