code: def _drawLine(self, image):
          
          w, h = image.size
          w *= 5
          h *= 5
  
          l_image = Image.new('RGBA', (w, h), (0, 0, 0, 0))
          l_draw = ImageDraw.Draw(l_image)
  
          x1 = int(w * random.uniform(0, 0.1))
          y1 = int(h * random.uniform(0, 1))
          x2 = int(w * random.uniform(0.9, 1))
          y2 = int(h * random.uniform(0, 1))
  
          # Line width modifier was chosen as an educated guess
          # based on default image area.
          l_width = round((w * h)**0.5 * 2.284e-2)
  
          # Draw
          l_draw.line(((x1, y1), (x2, y2)), fill=(0, 0, 0, 255), width=l_width)
  
          # Transform
          l_image = self._rndLineTransform(l_image)
          l_image = l_image.resize(image.size, resample=self.resample)
  
          # Paste onto image
          image.paste(l_image, (0, 0), l_image)
docs: Draw morphed line in Image object.