class TestIMImage(unittest.TestCase): def setUp(self): self.img = Image() self.is_imagemagick = False if gminfo.library == 'ImageMagick': self.is_imagemagick = True def test_adaptiveBlur(self): if self.is_imagemagick: self.img.adaptiveBlur() def test_distort(self): if self.is_imagemagick: self.img.distort(DistortImageMethod.ScaleRotateTranslateDistortion, 1, 1.0, True) def test_extent(self): if self.is_imagemagick: self.img.extent(Geometry(100, 100)) def test_inverseFourierTransform(self): if self.is_imagemagick: phase = Image() self.img.inverseFourierTransform(phase) def test_sigmoidalContrast(self): if self.is_imagemagick: self.img.sigmoidalContrast(2, 2.) def test_splice(self): if self.is_imagemagick: self.img.splice(Geometry(100, 100)) def test_sparseColor(self): if self.is_imagemagick: self.img.sparseColor(ChannelType.RedChannel, SparseColorMethod.PolynomialColorInterpolate, 1, 1.) def test_sparseColor(self): if self.is_imagemagick: ret = self.img.exifProfile() self.assertEqual(type(ret), type(pgmagick._pgmagick.Blob())) def test_virtualPixelMethod(self): if self.is_imagemagick: ret = self.img.virtualPixelMethod() self.assertEqual(type(ret), type(pgmagick._pgmagick.VirtualPixelMethod()))
def test_extent(self): im = Image(Geometry(300, 200), Color('transparent')) g = Geometry(10, 10) im.extent(g)