PythonMagick_writeImages

Discussion in 'Python' started by Cousin Stanley, Nov 22, 2003.

  1. 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
    Cousin Stanley, Nov 22, 2003
    #1
    1. Advertising

  2. Cousin Stanley

    Achim Domma Guest

    "Cousin Stanley" <> wrote in message
    news:bpoi9l$1p3k0e$-berlin.de...

    Hi,

    > TypeError: bad argument type for built-in operation
    > Magick: Failed to close module ("UnregisterJPEGImage: The operation

    completed successfully.").

    the last line seems to be the real error. PythonMagick is only a wrapper
    around GraphicsMagick. To me it looks like this is not a problem of the
    wrapper, but of GraphicsMagick. You might subscribe to the GraphicsMagick
    APIs Mailinglist and ask Bob about this error.

    regards,
    Achim
    Achim Domma, Nov 23, 2003
    #2
    1. Advertising

  3. Achim ....

    This problem doesn't seem to be unique to JPG files
    and also shows up with the wxPython/PythonMagick example
    in the current tutorial posted at ....

    http://www.procoders.net/moinmoin/PythonMagick

    python wxp_pm.py
    Magick: Failed to close module ("UnregisterPNGImage: The operation completed suc
    cessfully.
    ").
    Magick: Failed to close module ("UnregisterRGBImage: The operation completed suc
    cessfully.

    As with most of the simple examples from the original PythonMagick tutorial,
    with the exception of the writeImages function noted in my original post
    and a different problem with example4.py , this wxp_pm.py program seems to do
    the desired image processing as expected in spite of the Failed to close module
    error ....

    The versions of the original PythonMagick tutorial that I use
    along with their output images can be found at ....

    http://fastq.com/~sckitching/Python/PythonMagick_tut_0.zip
    [ 248 KB ]

    It would be interesting to know if these run OK
    with the Standard Python 2.3 distribution in order
    to determine if there might be some quirk with
    the Enthought Edition or with my setup ....

    In the meantime, I will look for the GraphicsMagick API mailing list ....

    --
    Cousin Stanley
    Human Being
    Phoenix, Arizona
    Cousin Stanley, Nov 23, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page