Page 1 of 1

Possible bug writing small .gif images

Posted: 2011-04-04T07:15:14-07:00
by odrm

Code: Select all

$ convert -version
Version: ImageMagick 6.6.9-1 2011-04-04 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP OpenCL  
Small images with a transparent background are incorrectly saved with a black background. To reproduce:

Code: Select all

$ convert -size 16x16 xc:none -fill blue -draw 'rectangle 4,4 8,8' s.gif
$ identify -verbose s.gif
...
  Histogram:
       230: (  0,  0,  0,255) #000000 black
         1: (  0,  0,  0,  0) #00000000 none
        25: (  0,  0,255,255) #0000FF blue
...
The transparency wasn't saved, but was replaced with black. For a larger image, this doesn't appear to happen:

Code: Select all

$ convert -size 32x32 xc:none -fill blue -draw 'rectangle 4,4 8,8' m.gif
$ identify -verbose m.gif
...
  Histogram:
       999: (  0,  0,  0,  0) #00000000 none
        25: (  0,  0,255,255) #0000FF blue
...

Re: Possible bug writing small .gif images

Posted: 2011-04-04T07:53:15-07:00
by magick
We'll add a patch to fix this problem to the next point release of ImageMagick. Thanks.

Re: Possible bug writing small .gif images

Posted: 2011-04-14T08:09:11-07:00
by sas
I might be hitting the same bug (also using ImageMagick 6.6.9-1).

In my case it doesn't replace transparent pixels with black, however, but rather with the "Alpha" background color saved with the image:

bullet.png Image

Code: Select all

$  identify -verbose bullet.png | grep "Alpha: "
  Alpha: rgba(255,0,0,0)   #FF000000

Code: Select all

$  convert bullet.png bullet.gif
--> bullet.gif: Image (Also note the top-left pixel being set to grey)

Code: Select all

$  identify -verbose bullet.gif | grep "Alpha: "
  Alpha: none   #00000000
This happens to me for images of size 10 x 25px or smaller, but not with larges ones.

Re: Possible bug writing small .gif images

Posted: 2011-04-14T09:35:09-07:00
by fmw42
The following works fine for me under IM 6.6.9.4 Q16 Mac OSX Tiger.



convert -size 16x16 xc:none -fill blue -draw 'rectangle 4,4 8,8' tmp.gif

identify -verbose tmp.gif

Code: Select all

Format: GIF (CompuServe graphics interchange format)
  Class: PseudoClass
  Geometry: 16x16+0+0
  Resolution: 72x72
  Print size: 0.222222x0.222222
  Units: Undefined
  Type: PaletteMatte
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8/1-bit
...
  Histogram:
       231: (  0,  0,  0,  0) #00000000 none
        25: (  0,  0,255,255) #0000FF blue
  Colormap: 2
         0: (  0,  0,255,255) #0000FF blue
         1: (  0,  0,  0,  0) #00000000 none

Re: Possible bug writing small .gif images

Posted: 2011-04-14T13:07:14-07:00
by sas
After upgrading to ImageMagick 6.6.9-4 2011-04-11 Q16, it works as expected now. Great!
fmw42 wrote:convert -size 16x16 xc:none -fill blue -draw 'rectangle 4,4 8,8' tmp.gif
That probably always worked, the problem was only with images with width ≤10px and height ≤ 25px (at least for me).

Re: Possible bug writing small .gif images

Posted: 2011-04-16T01:03:00-07:00
by anthony
Small GIF files with transparency is still broken!!!!

Code: Select all

   convert -size 9x9 xc:none png: | convert - -scale 1000% show:
will show a transparent image which is what I asked for.

Code: Select all

   convert -size 9x9 xc:none gif: | convert - -scale 1000% show:
shows an all black image but for a single transparent pixel in the top-left

Re: Possible bug writing small .gif images

Posted: 2012-08-07T21:33:06-07:00
by anthony
This is still broken!!!!

Re: Possible bug writing small .gif images

Posted: 2012-08-07T21:36:19-07:00
by fmw42
anthony wrote:This is still broken!!!!
see also viewtopic.php?f=1&t=21583

Re: Possible bug writing small .gif images

Posted: 2012-08-08T06:43:29-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.7.8-9 Beta. Thanks.