Hello anand,
Thanks for Answering ,
wanted to check why you have multiplied by  —
“b = a[:,:, 0]* 1000000 + a[:,:,1]*1000 + a[:,:,2]”
Also after uploading a image in png format
it is giving result as -
tensor([0., 0., 0.]).