diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py
--- a/src/PIL/TiffImagePlugin.py
+++ b/src/PIL/TiffImagePlugin.py
@@ -567,6 +567,9 @@ def _setitem(self, tag, value, legacy_api):
         if self.tagtype[tag] == 7 and py3:
             values = [value.encode("ascii", 'replace') if isinstance(
                       value, str) else value]
+        elif self.tagtype[tag] == 5:
+            values = [float(v) if isinstance(v, int) else v
+                      for v in values]
 
         values = tuple(info.cvt_enum(value) for value in values)
 

diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py
--- a/Tests/test_file_libtiff.py
+++ b/Tests/test_file_libtiff.py
@@ -231,6 +231,16 @@ def test_additional_metadata(self):
 
         TiffImagePlugin.WRITE_LIBTIFF = False
 
+    def test_int_dpi(self):
+        # issue #1765
+        im = hopper('RGB')
+        out = self.tempfile('temp.tif')
+        TiffImagePlugin.WRITE_LIBTIFF = True
+        im.save(out, dpi=(72, 72))
+        TiffImagePlugin.WRITE_LIBTIFF = False
+        reloaded = Image.open(out)
+        self.assertEqual(reloaded.info['dpi'], (72.0, 72.0))
+
     def test_g3_compression(self):
         i = Image.open('Tests/images/hopper_g4_500.tif')
         out = self.tempfile("temp.tif")

Save compressed TIFF only accepts float values for dpi
There is a trap in setting the resolution for compressed TIFF images.  

```python
# pillow v3.1.1

import PIL.Image
im = PIL.Image.new('CMYK', (100, 100))

dpi = 100.0  # works
dpi = 100  # fails

im.save('test.tif', format='TIFF',
        dpi=(dpi, dpi),
        compression='tiff_lzw',
        #compression='tiff_deflate',
        #compression='tiff_adobe_deflate'
        )
```

Integers fail silently resulting in the resolution value missing from the saved file. Floats work as expected.

