Skip to content

Commit 2a4a949

Browse files
committed
Merge pull request matplotlib#1226 from efiring/fix_tiff_dpi
Add dpi kwarg to PIL image.save method for TIFF file.
2 parents 781c3a4 + c7f997d commit 2a4a949

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/backend_bases.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,9 @@ def print_tif(self, filename_or_obj, *args, **kwargs):
19101910
buf, size = agg.print_to_buffer()
19111911
if kwargs.pop("dryrun", False): return
19121912
image = Image.frombuffer('RGBA', size, buf, 'raw', 'RGBA', 0, 1)
1913-
return image.save(filename_or_obj, format='tiff')
1913+
dpi = (self.figure.dpi, self.figure.dpi)
1914+
return image.save(filename_or_obj, format='tiff',
1915+
dpi=dpi)
19141916
print_tiff = print_tif
19151917

19161918
def get_supported_filetypes(self):

0 commit comments

Comments
 (0)