convert.exe: geometry does not contain image `png.png'

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
kwyjibo
Posts: 7
Joined: 2012-08-15T12:34:55-07:00
Authentication code: 67789

convert.exe: geometry does not contain image `png.png'

Post by kwyjibo »

I'm trying to create a gif from small images that are stored on a single png, the "png.png" file size is 1024x1024.

Code: Select all

convert -crop 32x32+352+800 +repage -dispose 3 -delay 10 "png.png" -crop 32x32+384+800 +repage -dispose 3 -delay 10 "png.png" -page 0x0 -dispose 3 -delay 100 -size 32x32 xc:Transparent -crop 32x32+288+800 +repage -dispose 3 -delay 10 "png.png" -crop 32x32+320+800 +repage -dispose 3 -delay 10 "png.png" -loop 0 +dither -layers optimize "out.gif"
in a more readable form:
convert
-crop 32x32+352+800 +repage -dispose 3 -delay 10 "png.png"
-crop 32x32+384+800 +repage -dispose 3 -delay 10 "png.png"
-page 0x0 -dispose 3 -delay 100 -size 32x32 xc:Transparent
-crop 32x32+288+800 +repage -dispose 3 -delay 10 "png.png"
-crop 32x32+320+800 +repage -dispose 3 -delay 10 "png.png"
-loop 0 +dither -layers optimize "out.gif"


the error: convert.exe: geometry does not contain image `png.png' @ warning/transform.c/CropImage/574.

It generates a 1x1 pixels empty gif
The coordinates are correct I already checked them manually, I understand it has something to do with crop and repage but don't understand what after around 2 hours of testing and reading manuals and examples.

Hope someone can help me, thanks.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: convert.exe: geometry does not contain image `png.png'

Post by Bonzo »

I am not sure why it does not work but I can see straight away that the image should come before the crop.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert.exe: geometry does not contain image `png.png'

Post by fmw42 »

As Bonzo says, your syntax is incorrect. See http://www.imagemagick.org/Usage/basics/#why

For most image types (except vector formats), it should be

convert inputimage options outputimage
kwyjibo
Posts: 7
Joined: 2012-08-15T12:34:55-07:00
Authentication code: 67789

Re: convert.exe: geometry does not contain image `png.png'

Post by kwyjibo »

Thanks for the help, I read the page I'm not able to separate all the parameters into settings and commands by myself but I can check every command there and I believe I put them where they should be.

So I tried to simplify, moved the settings "delay" and "dispose" before the image, the operations "crop" and "repage" after the image.
Also tested without +repage and with -repage 0x0

convert -dispose 3 -delay 10 "png.png" -crop 32x32+352+800 +repage -dispose 3 -delay 10 "png.png" -crop 32x32+384+800 +repage "output.gif"
convert.exe: geometry does not contain image `png.png' @ warning/transform.c/CropImage/574.

more readable command line:

Code: Select all

convert
-dispose 3 -delay 10 "png.png" -crop 32x32+352+800 +repage
-dispose 3 -delay 10 "png.png" -crop 32x32+384+800 +repage
"output.gif"
Anyone testing/trying to do what I want to do would be nice.

My version, just in case:
Version: ImageMagick 6.7.8-8 2012-08-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert.exe: geometry does not contain image `png.png'

Post by fmw42 »

I am not sure what you are trying to do? But try

convert \
\( -dispose 3 -delay 10 "png.png" -crop 32x32+352+800 +repage \) \
\( -dispose 3 -delay 10 "png.png" -crop 32x32+384+800 +repage \) \
-loop 0 "output.gif"

or for windows

convert ^
( -dispose 3 -delay 10 "png.png" -crop 32x32+352+800 +repage ) ^
( -dispose 3 -delay 10 "png.png" -crop 32x32+384+800 +repage ) ^
-loop 0 "output.gif"

However, -delay 10 may be too fast for many animation viewers to use so it may animate slower than that.

see
http://www.imagemagick.org/Usage/basics/#parenthesis
kwyjibo
Posts: 7
Joined: 2012-08-15T12:34:55-07:00
Authentication code: 67789

Re: convert.exe: geometry does not contain image `png.png'

Post by kwyjibo »

So lame that I didn't know the parenthesis trick, I think that was the only thing wrong, the parameter order was being kinda tolerated.

Thanks a lot.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert.exe: geometry does not contain image `png.png'

Post by fmw42 »

If that works, try this. It will save reading the image twice.

convert "png.png" ^
( -dispose 3 -delay 10 -clone 0 -crop 32x32+352+800 +repage ) ^
( -dispose 3 -delay 10 -clone 0 -crop 32x32+384+800 +repage ) ^
-delete 0 -loop 0 "output.gif"
kwyjibo
Posts: 7
Joined: 2012-08-15T12:34:55-07:00
Authentication code: 67789

Re: convert.exe: geometry does not contain image `png.png'

Post by kwyjibo »

For that simple example delay is set to 0 according to gimp, for more complex ones like the real animations I'm creating with the script I get rubbish and the gif goes png.png size.

I guess the batch will just read files several times, hope windows cache helps, anyway I will only process in batch now and then so is not a big issue to read images more than once.

Thanks again for all the help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert.exe: geometry does not contain image `png.png'

Post by fmw42 »

For that simple example delay is set to 0 according to gimp, for more complex ones like the real animations I'm creating with the script I get rubbish and the gif goes png.png size.
Most viewers will not take a zero delay animation. If they accept it they will put some minimum value in anyway.
Post Reply