title: Boost.Python.ArgumentError: Python argument types in Image.__init__(Image, file) did not match C++ signature:
body: <p>The below is python code to remove background from an image. I followed the steps given in <a href="https://pypi.python.org/pypi/pgmagick/" rel="nofollow">https://pypi.python.org/pypi/pgmagick/</a> for installing pgmagick in mac osx mavericks. </p>
  
  <pre><code>    import pgmagick as pg
  
  
      def trans_mask_sobel(img):
          """ Generate a transparency mask for a given image """
  
          image = pg.Image(img)
  
          # Find object
          image.negate()
          image.edge()
          image.blur(1)
          image.threshold(24)
          image.adaptiveThreshold(5, 5, 5)
  
          # Fill background
          image.fillColor('magenta')
          w, h = image.size().width(), image.size().height()
          image.floodFillColor('0x0', 'magenta')
          image.floodFillColor('0x0+%s+0' % (w-1), 'magenta')
          image.floodFillColor('0x0+0+%s' % (h-1), 'magenta')
          image.floodFillColor('0x0+%s+%s' % (w-1, h-1), 'magenta')
  
          image.transparent('magenta')
          return image
  
      def alpha_composite(image, mask):
          """ Composite two images together by overriding one opacity channel """
  
          compos = pg.Image(mask)
          compos.composite(
              image,
              image.size(),
              pg.CompositeOperator.CopyOpacityCompositeOp
          )
          return compos
  
      def remove_background(filename):
          """ Remove the background of the image in 'filename' """
  
          img = pg.Image(filename)
          transmask = trans_mask_sobel(img)
          img = alphacomposite(transmask, img)
          img.trim()
          img.write('out.png')
  
      img = open("example.jpg")
      remove_background(img)
  </code></pre>
  
  <p>While running this i am encountering the following error</p>
  
  <pre><code>Traceback (most recent call last):
    File "imgrm.py", line 48, in &lt;module&gt;
      remove_background(img)
    File "imgrm.py", line 41, in remove_background
      img = pg.Image(filename)
  Boost.Python.ArgumentError: Python argument types in
      Image.__init__(Image, file)
  did not match C++ signature:
      __init__(_object*, Magick::Image)
      __init__(_object*, unsigned int, unsigned int, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, MagickLib::StorageType, char const*)
      __init__(_object*, Magick::Blob, Magick::Geometry, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;)
      __init__(_object*, Magick::Blob, Magick::Geometry, unsigned int, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;)
      __init__(_object*, Magick::Blob, Magick::Geometry, unsigned int)
      __init__(_object*, Magick::Blob, Magick::Geometry)
      __init__(_object*, Magick::Blob)
      __init__(_object*, Magick::Geometry, Magick::Color)
      __init__(_object*, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;)
      __init__(_object*)
  </code></pre>
  
  <p>What is the issue? How can i solve it?</p>