本文整理匯總了Python中daguerre.adjustments.Fill.adjust方法的典型用法代碼示例。如果您正苦於以下問題:Python Fill.adjust方法的具體用法?Python Fill.adjust怎麽用?Python Fill.adjust使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類daguerre.adjustments.Fill
的用法示例。
在下文中一共展示了Fill.adjust方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_adjust__unequal
# 需要導入模塊: from daguerre.adjustments import Fill [as 別名]
# 或者: from daguerre.adjustments.Fill import adjust [as 別名]
def test_adjust__unequal(self):
im = Image.open(self._data_path('100x100.png'))
fill = Fill(width=50, height=40)
adjusted = fill.adjust(im)
self.assertEqual(adjusted.size, (50, 40))
expected = Image.open(self._data_path('50x40_fill.png'))
self.assertImageEqual(adjusted, expected)
示例2: test_adjust__max_width__smaller
# 需要導入模塊: from daguerre.adjustments import Fill [as 別名]
# 或者: from daguerre.adjustments.Fill import adjust [as 別名]
def test_adjust__max_width__smaller(self):
im = Image.open(self._data_path('100x100.png'))
fill = Fill(height=100, max_width=50)
adjusted = fill.adjust(im)
self.assertEqual(adjusted.size, (50, 100))
expected = Image.open(self._data_path('50x100_crop.png'))
self.assertImageEqual(adjusted, expected)
示例3: test_adjust__max_width
# 需要導入模塊: from daguerre.adjustments import Fill [as 別名]
# 或者: from daguerre.adjustments.Fill import adjust [as 別名]
def test_adjust__max_width(self):
im = Image.open(self._data_path('100x100.png'))
fill = Fill(height=50, max_width=200)
adjusted = fill.adjust(im)
self.assertEqual(adjusted.size, (50, 50))
expected = Image.open(self._data_path('50x50_fit.png'))
self.assertImageEqual(adjusted, expected)