def image_description(shape, colormaped=False, **metadata):
 if colormaped:
  shape = (shape + (3,))
 metadata.update({'shape': shape})
 return json.dumps(metadata).encode('utf-8')

def image_description ( shape , colormaped = False , ** metadata ) : if colormaped : shape = ( shape + ( 3 , ) ) metadata . update ( { 'shape' : shape } ) return json . dumps ( metadata ) . encode ( 'utf-8' )
return image description from data shape and meta data .