The example assumes that the file is a dump of uin16 512x512 array.
So, no doubt that it won't work with a png file.

See

http://matplotlib.sourceforge.net/users/image_tutorial.html

-JJ


On Tue, Mar 23, 2010 at 9:41 AM, yogesh karpate <yogeshkarp...@gmail.com> wrote:
> The 1st code snippet of image_demo2.py is as follows
>
> #!/usr/bin/env python
> from pylab import *
>
> w, h = 512, 512
> s = file('../data/ct.raw', 'rb').read()
> A = fromstring(s, uint16).astype(float)
>
> A *= 1.0/max(A)
> A.shape = w, h
>
> I replaced s = file('../data/ct.raw', 'rb').read()  with s =
> file('/home/jaguar/Developemnt/image_demo2.png', 'rb').read()
>
> The image is same as in given demo example(its given in .png format) and
> rest of code is also same.....
>
> when I run it it gives the error as "
> A = fromstring(s, uint16).astype(float)
> ValueError: string size must be a multiple of element size"
>
> WHat can be the error in program? I may asking stupid question Thanks in
> advance !
> Regards
> Yogesh
>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to