Skip to content

Fixed save_image to correctly output values in the full byte range. #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2017

Conversation

bobbens
Copy link
Contributor

@bobbens bobbens commented Jan 23, 2017

After changing this I saw the issue #24 which mentions this and mentions adding a range option. For now I've just removed the .mul(0.5).add(0.5) as without it, the follow code does not properly save the image.

import torch
import torchvision
from PIL import Image
I  = Image.open( './lena.jpg' )
I2 = torchvision.transforms.ToTensor()( I )
torchvision.utils.save_image( I2, 'test.jpg' )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants