PythonMagick_writeImages

Cousin Stanley CousinStanley at hotmail.com
Sat Nov 22 21:59:26 CET 2003


I'm trying to get PythonMagick going using .... 

    Enthought Edition Python 2.3
    PythonMagick-0[1].5-Q16.python23.win32.exe

The following small example script from the old PythonMagick tutorial
worked for me just as coded below using Python 2.2.1 and an earlier release 
of PythonMagick, which has been uninstalled, but now throws   
TypeError: bad argument type  when calling the  writeImages( .... )  function .... 

# animate1.py --------------------------------------------------------------

from PythonMagick import *

img1 = Image( './img/01.jpg' )

img1.scale( "100x100" )

img2 = Image( img1 )

img2.blur( 5 , 1.5 )

imgs = animateImages( [ img1 , img2 ] )   

writeImages( imgs , './out/a1_kirstin.gif' , 1 )       # Line 14 .... Problem occurs here

# ------------------------------------------------------

python animate1.py
Traceback (most recent call last):
  File "animate1.py", line 14, in ?
    writeImages( imgs , './out/a1_kirstin.gif' , 1 )
TypeError: bad argument type for built-in operation
Magick: Failed to close module ("UnregisterJPEGImage: The operation completed successfully.").

# ---------------------------------------------------------

The only documentation I've found about  writeImages()  
is from some  Magick++  docs, but I'm unsure how to 
actually interpret it as my  C++  experience is almost non-existent  .... 

     http://www.imagemagick.org/www/Magick++/STL.html 

    writeImages    InputIterator first_,  
                             InputIterator last_, 
                             const std::string &imageSpec_, 
                             bool adjoin_ = true 


    Write images in container to file specified by string imageSpec_. 

    Set adjoin_ to false to write a set of image frames via a wildcard imageSpec_ 
    (e.g. image%02d.miff). 

    The wildcard must be one of %0Nd, %0No, or %0Nx.

    Caution: if an image format is selected which is capable of supporting fewer colors 
    than the original image or quantization has been requested, the original image will be 
    quantized to fewer colors. Use a copy of the original if this is a problem. 

# ---------------------------------------------------------------------------------------------------

All of the other PythonMagick examples from the original tutorial
seem to work OK except the two that compose animated GIFs 
using the  writeImage  function .... 

Any clues ????

-- 
Cousin Stanley
Human Being
Phoenix, Arizona





More information about the Python-list mailing list