convert appears to skip some frames when making GIFs

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
CasperVector
Posts: 4
Joined: 2012-10-22T02:44:38-07:00
Authentication code: 67789

convert appears to skip some frames when making GIFs

Post by CasperVector »

When making GIF animation with convert(1) like following:

Code: Select all

$ convert -loop 0 -delay 25 testframe*.png test-convert.gif
some (namely No. 10 and 11 of totally 18) frames are missing from the generated GIF file, while GIF produced from GIMP does have this problem.
I can supply the test files (in a 1.3M tarball) if you permit.

OS: Gentoo amd64 unstable
ImageMagick version: 6.7.9.9.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: convert appears to skip some frames when making GIFs

Post by glennrp »

Maybe those PNG file contain offset info that puts them outside the frame. Look at "identify -verbose testframe*.png" for clues. If that doesn't help then you can mail the tarball to glennrp at gmail dot com and I'll take a look.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert appears to skip some frames when making GIFs

Post by fmw42 »

try

convert -delay 25 testframe*.png +repage -loop 0 test-convert.gif
CasperVector
Posts: 4
Joined: 2012-10-22T02:44:38-07:00
Authentication code: 67789

Re: convert appears to skip some frames when making GIFs

Post by CasperVector »

fmw42 wrote: try
convert -delay 25 testframe*.png +repage -loop 0 test-convert.gif
Tried, but the problem persists :(
CasperVector
Posts: 4
Joined: 2012-10-22T02:44:38-07:00
Authentication code: 67789

Re: convert appears to skip some frames when making GIFs

Post by CasperVector »

glennrp wrote: Maybe those PNG file contain offset info that puts them outside the frame. Look at "identify -verbose testframe*.png" for clues. If that doesn't help then you can mail the tarball to glennrp at gmail dot com and I'll take a look.

Code: Select all

% identify -verbose testframe10.png
Image: testframe10.png
  Format: PNG (Portable Network Graphics)
  Class: DirectClass
  Geometry: 480x480+0+0
  Units: Undefined
  Type: TrueColor
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Red:
      min: 0 (0)
      max: 255 (1)
      mean: 204.753 (0.802952)
      standard deviation: 36.7577 (0.144148)
      kurtosis: 2.38527
      skewness: -1.36099
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 204.753 (0.802952)
      standard deviation: 36.7577 (0.144148)
      kurtosis: 2.38527
      skewness: -1.36099
    Blue:
      min: 1 (0.00392157)
      max: 243 (0.952941)
      mean: 205.081 (0.804237)
      standard deviation: 35.7118 (0.140046)
      kurtosis: 1.37428
      skewness: -1.18864
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 204.862 (0.80338)
      standard deviation: 36.4124 (0.142794)
      kurtosis: 2.07972
      skewness: -1.30751
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 480x480+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    Comment: Render Date: 2012-10-22 08:15:18Z
Platform: x86_64-pc-linux-gnu
Compiler: x86_64-pc-linux-gnu-g++ 4.6.3

    date:create: 2012-10-23T12:59:08+08:00
    date:modify: 2012-10-22T16:16:16+08:00
    png:cHRM                 : chunk was found (see Chromaticity, above)
    png:gAMA                 : gamma=0.45454544 (See Gamma, above)
    png:IHDR.bit_depth       : 8
    png:IHDR.color_type      : 2 (Truecolor)
    png:IHDR.interlace_method: 0 (Not interlaced)
    png:IHDR.width,height    : 480, 480
    png:oFFs                 : x_off=0, y_off=0
    png:sRGB                 : intent=0 (Perceptual Intent)
    png:text                 : 2 tEXt/zTXt/iTXt chunks were found
    signature: e8dc3cffef90cd2474349a5df15186ccb2e2e85ac842614620caf33994a188d0
    Software: POV-Ray 3.7.0.RC5
  Artifacts:
    filename: testframe10.png
    verbose: true
  Tainted: False
  Filesize: 26.5KB
  Number pixels: 230K
  Pixels per second: 11.52MB
  User time: 0.010u
  Elapsed time: 0:01.019
  Version: ImageMagick 6.7.9-9 2012-10-05 Q16 http://www.imagemagick.org
So the offsets (png:oFFs, please correct me if that's wrong, since I'm not familar with these details of the PNG format) seem to be fine.
I have just sent the test files to the mail address you mentioned.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: convert appears to skip some frames when making GIFs

Post by glennrp »

CasperVector wrote:
glennrp wrote: Maybe those PNG file contain offset info that puts them outside the frame. Look at "identify -verbose testframe*.png" for clues. If that doesn't help then you can mail the tarball to glennrp at gmail dot com and I'll take a look.
So the offsets (png:oFFs, please correct me if that's wrong, since I'm not familar with these details of the PNG format) seem to be fine.
I have just sent the test files to the mail address you mentioned.
I don't see anything wrong with test-convert.gif; all 18 frames are present and there aren't any non-zero offsets or anything else unusual about any of the frames. I also reran your convert command with my copy of IM-6.8.0-2 and got the same result but with some slight color differences. With my copy of IM-6.7.9-9 I got an output GIF that is identical to yours. How are you determining that the two frames are missing? "identify" is showing them to me and so is the viewer that I use.
CasperVector
Posts: 4
Joined: 2012-10-22T02:44:38-07:00
Authentication code: 67789

Re: convert appears to skip some frames when making GIFs

Post by CasperVector »

glennrp wrote: I don't see anything wrong with test-convert.gif; all 18 frames are present and there aren't any non-zero offsets or anything else unusual about any of the frames. I also reran your convert command with my copy of IM-6.8.0-2 and got the same result but with some slight color differences. With my copy of IM-6.7.9-9 I got an output GIF that is identical to yours. How are you determining that the two frames are missing? "identify" is showing them to me and so is the viewer that I use.
I see, I just discovered that test-convert.gif appears to skip frame No. 10 & 11 in EOG (Eye of GNOME), while looks all right in Windows Image Viewer.
I'll report this to EOG devs and post their feedbacks after they resolved this issue (because I still can not confirm this is a pure EOG issue or an IM issue mixed up with an EOG issue)...
Post Reply