Confused about the images display of tensorboard

I use tensorboard to record my image,here is the output:
pic1

and I use the matplotlib.pyplot.imshow,The ploted image is in the reply

the raw Image series format was tiff,int32.
After reading the picture, the data type is torch.float32, however it is not work even if i changed the type to int32
here is part of my code:
‘’’
writer = SummaryWriter(‘runs/another_scalar_example’)

#img = torch.cat((img,img,img),dim=1)

imagegrid = torchvision.utils.make_grid(img,nrow=16)
imagesample = img[0]
imagesample = imagesample.type(torch.ShortTensor)

writer.add_image(‘jb’,imagesample,global_step=1,dataformats=‘CHW’)
writer.add_image(‘countdown’,imagegrid,dataformats=‘CHW’)
‘’’

pic2