possible bug in creating multiframe files IM 6.7.3.0

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug in creating multiframe files IM 6.7.3.0

Post by fmw42 »

IM 6.7.3.0 Q16 Mac OSX Tiger

I am having trouble making an animation when using certain (GIMP created) images and saving the frames in IM as MIFF, PAM, TIFF before creating the animation. If I use -strip on the "bgimage" before processing then it works with PAM, etc. Here is an example using my pagecurl script to create frames and then a small script to animate them in GIF output.

image: (the problem image)
Image

bgimage:
Image


image="mandril3.png"
bgimage="gimp_256x256.png"
for ((i=5; i<=105; i=i+10)); do
echo >&2 i=$i
pagecurl -a $i "$image" "$bgimage" PAM:
done | convert \
-dispose background \
-delay 100 "$image" \
-delay 10 - \
\( -delay 10 -clone -1-1 \) \
-delay 100 "$image" \
-loop 0 -layers Optimize \
pagecurl_animation.gif
convert: negative or zero image size `tmp.pam' @ error/pnm.c/ReadPNMImage/405.

With MIFF: I get the following error:
convert: no decode delegate for this image format `/var/tmp/magick-qW5O6k6U' @ error/constitute.c/ReadImage/532.

With TIFF: I get the following error:
convert: no decode delegate for this image format `/var/tmp/magick-UYGlw0kV' @ error/constitute.c/ReadImage/532.

To make the testing easier, I have split the process into two parts. The first part makes the PAM frames with no error. But when I try to display them I get similar error messages. It seems that the files are not saving the multiple frames.

image="mandril3.png"
bgimage="gimp_256x256.png"
for ((i=5; i<=105; i=i+10)); do
echo >&2 i=$i
pagecurl -a $i "$image" "$bgimage" tmp.miff
done

http://www.fmwconcepts.com/misc_tests/a ... g/tmp.miff
http://www.fmwconcepts.com/misc_tests/a ... ug/tmp.pam
http://www.fmwconcepts.com/misc_tests/a ... g/tmp.tiff




What is it that -strip is removing that makes this work?

convert gimp_256x256.png -strip gimp_256x256_strip.png
image="mandril3.png"
bgimage="gimp_256x256_strip.png"
for ((i=5; i<=105; i=i+10)); do
echo >&2 i=$i
pagecurl -a $i "$image" "$bgimage" pam:
done | convert \
-dispose background \
-delay 100 "$image" \
-delay 10 - \
\( -delay 10 -clone -1-1 \) \
-delay 100 "$image" \
-loop 0 -layers Optimize \
pagecurl_animation2.gif

Image



NOTE also if swapping the order of the two images then it works fine also.

image="gimp_256x256.png"
bgimage="mandril3.png"
for ((i=5; i<=105; i=i+10)); do
echo >&2 i=$i
pagecurl -a $i "$image" "$bgimage" pam:
done | convert \
-dispose background \
-delay 100 "$image" \
-delay 10 - \
\( -delay 10 -clone -1-1 \) \
-delay 100 "$image" \
-loop 0 -layers Optimize \
pagecurl_animation3.gif


Image
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug in creating multiframe files IM 6.7.3.0

Post by anthony »

It is probably a "compose" setting being passed in MIFF. This is saved with images by GIMP for layering purposes. That is allows different layers to be 'composed' into the working canvas using different composition methods.

In Gimp layers are preserved and composited only for display purposes, so individual layers can be worked on further.
In IM layers are more typically composited into the result as soon as they are created, to reduce the number of images in memory. Sort of the different between interactive processing and batch processing.

Also really only the layering operations (-flatten)could really make sensible use of per-image compose method settings. The operator only does so if -compose was never set. In IMv6 as soon as you do set -compose per-image compose settings (image properties or attributes) are replaced ;-(

I was just looking at the this setting in my IMv7 CLI redevelopment just last Friday. I concluded that I would actually like to make more use of per-image compose settings, though only for layering and saving purposes. I have made notes about it, and will be looking at it in more detail. It will be in my mind as to look at properly defining, and detailing what each setting does in terms of modifying 'attributes', 'properities', 'global options', 'artifacts', and so on. Currently it is a bit of a mess in terms of just what exactly each setting does.

It is definitely time for a clean up.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply