I am trying to create a 16-bit image like so:
import skimage
import random
from random import randint
xrow=raw_input("Enter the number of rows to be present in image.=>")
row=int(xrow)
ycolumn=raw_input("Enter the number of columns to be present in image.=>")
column=int(ycolumn)
A={}
for x in xrange(1,row):
for y in xrange(1,column):
a=randint(0,65535)
A[x,y]=a
imshow(A)
But I get the error TypeError: Image data can not convert to float.


Ais a dictionary, yet you are assuming that it's an image type for display. That's why you're getting theTypeError. However, I'm very confused because I don't know which image library you're using. You've importedscikit-imageyet you tagged your post as using PIL. In addition, theimshowcall is ambiguous because I don't know which package that comes from. None of yourimportstatements makes that clear to me. Please edit your question to address what packageimshowcomes from and which image library you'd like to use for your post. BTW, images are indexed starting at0.