why does pytorch's utils.save_image() change the color of my image
I am saving two images with pytorch's utils.save_image() function here. one is the real image and the other, the perturbed image (just a patch). However, the latter image lost its real appearance when saved with save_image().
# save source image
utils.save_image(data.data, &quot;./%s/%d_%d_org.png&quot; % (&quot;log&quot;, batch_idx, labels),
                            normalize=True)
    
# save adv image
utils.save_image(noised_data.data, &quot;./%s/%d_%d_adv.png&quot; % (&quot;log&quot;, batch_idx, target_class), normalize=True)

This is the saved clean image
This is the saved perturbed image 

So, I managed to solve this by adding make_grid() to the save method and clipping the image to [0,1] without normalizing.
utils.save_image(utils.make_grid(torch.clip(noised_data.data, 0, 1)), &quot;./%s/%d_%d_adv.png&quot; % (&quot;log&quot;, batch_idx, target_class))

