mimwrite and kargs

244 views
Skip to first unread message

A Al

unread,
Mar 7, 2017, 5:54:05 PM3/7/17
to imageio

Hi There,
I'm not sure if this is the best place to ask this - but a decent google search hasn't come up with any answers yet.

I'm using imageio to create animated gifs with python, and as long as I don't use kargs everything works without error. However I've been getting the following error whenever I try to use keyword arguments:

TypeError: _open() got an unexpected keyword argument 'duration '

Here's my code:
images=[]
for ii in range(numFrames):
    ax
.plot(data[ii])
    plt
.savefig(str(ii)+'.png',dpi=300,bbox_inches='tight')
    images
.append(imageio.imread(str(ii)+'.png'))
   

kargs
= { 'duration ': 1 }
imageio
.mimwrite('myMovie.gif', images, format='GIF', **kargs)  



This error also occurs if I try to use "quantizer" or "subrectangles".

My system is a JuypterHub 64-bit Ubuntu Linux server, with Anaconda and python 3.5..2.

Any advice here would be greatly appreciated. 

The full trace is:
TypeError                                 Traceback (most recent call last)
<ipython-input-39-acc06e685529> in <module>()
      1 kargs = { 'duration ': 1 }
----> 2 imageio.mimwrite('myMovie.gif', images, format='GIF', **kargs)

/opt/conda/lib/python3.5/site-packages/imageio/core/functions.py in mimwrite(uri, ims, format, **kwargs)
    300 
    301     # Get writer
--> 302     writer = get_writer(uri, format, 'I', **kwargs)
    303     with writer:
    304 

/opt/conda/lib/python3.5/site-packages/imageio/core/functions.py in get_writer(uri, format, mode, **kwargs)
    154 
    155     # Return its writer object
--> 156     return format.get_writer(request)
    157 
    158 

/opt/conda/lib/python3.5/site-packages/imageio/core/format.py in get_writer(self, request)
    180             raise RuntimeError('Format %s cannot write in mode %r' % 
    181                                (self.name, select_mode))
--> 182         return self.Writer(self, request)
    183 
    184     def can_read(self, request):

/opt/conda/lib/python3.5/site-packages/imageio/core/format.py in __init__(self, format, request)
    216             self._request = request
    217             # Open the reader/writer
--> 218             self._open(**self.request.kwargs.copy())
    219 
    220         @property

TypeError: _open() got an unexpected keyword argument 'duration '


Thank you,

~ A 

almar...@gmail.com

unread,
Mar 8, 2017, 4:13:26 AM3/8/17
to A Al, imageio

I think its because you have an extra space in ‘duration  ‘.

 

Regards,

  Almar

--
You received this message because you are subscribed to the Google Groups "imageio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imageio+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/imageio.
For more options, visit https://groups.google.com/d/optout.

 

A Al

unread,
Mar 8, 2017, 12:45:53 PM3/8/17
to imageio, aba...@gmail.com
My fat fingers and I thank you!

~ A
Reply all
Reply to author
Forward
0 new messages