title: How to properly scale an Image with PIL resize or transform on python
body: <p>I would like to know if you guys know how to properly scale an Image with PIL methods, Iǘe read and I know with:
      im.resize(size_tuple)
  but I just keep getting my image incomplete once it is scale, here is my code and my pictures as result, hope you can help me, thanks</p>
  
  <pre><code>if image_size[0] &lt;  120 and image_size[1] &lt;  155:
       image = image.resize((120,155),Image.ANTIALIAS)
       image.save(f_out)
  </code></pre>
  
  <p>the code saves my resized image but it shows a black line at the bottom and the image is crop and not complete, any ideas how to solve this?, thanks in advance</p>
  
  <p>UPDATE:
  this is the complete code I'm using</p>
  
  <pre><code>def makeThumb(f_in, f_out, size=(120,155), pad=False):
      image = Image.open(f_in)
      avatar_size = (120,155)
      image_size = image.size
      method = Image.NEAREST if image_size == avatar_size else Image.ANTIALIAS
  
      if pad:
          thumb = image.crop( (0, 0, size[0], size[1]) )
          offset_x = max( (size[0] - image_size[0]) / 2, 0 )
          offset_y = max( (size[1] - image_size[1]) / 2, 0 )
          thumb = ImageChops.offset(thumb, offset_x, offset_y)
  
      else:
          if image_size[0] &lt;  120 and image_size[1] &lt;  155:
              image = image.resize((120,155),Image.ANTIALIAS)
              image.save(f_out)          
          else:
              thumb = ImageOps.fit(image, size, method,0.05,(0.5, 0.5))
  </code></pre>