PIL image resize change the value of pixel?
I want to resize an PIL image without changing the pixel value range. 
I have tried the Image.resize() but it changes my pixel value range from [0,255] to [79,179]

I'm using Python and PyTorch, in PyTorch, the transforms.resize() will implement Image.resize()

Here is the test code I used

a = torch.randint(0,255,(500,500), dtype=torch.uint8)
print(a.size())
print(torch.max(a))
a = torch.unsqueeze(a, dim =0)
print(a.size())
compose = transforms.Compose([transforms.ToPILImage(),transforms.Resize((128,128))])
a_trans = compose(a)
print(a_trans.size)
print(a_trans.getextrema())


The output of the code is:

torch.Size([500, 500])
tensor(254, dtype=torch.uint8)
torch.Size([1, 500, 500])
(128, 128)
(79, 179)


So someone could explain why the output range is [79,179]?
If I want to do the resize without changing the value range, what should I do?
Thank you in advance 

Try resize with Nearest neighbor algorithm implemented in pil. It doesn't change pixels 
