Wand scale_rotate_translate Distortion Method Python
Last Updated :
11 May, 2020
One more common distortion method is scale_rotate_translate. A large number of arguments are controlled by scale_rotate_translate method. Arguments controlled by scale_rotate_translate method are as follows:
- X
- Y
- ScaleX
- ScaleY
- Angle
- NewX
- NewY
Syntax: BaseImage.distort(‘scale_rotate_translate’, **kwargs)
Input Image:
Example #1:
from wand.color import Color
from wand.image import Image
with Image(filename = 'gog.png' ) as img:
img.resize( 140 , 92 )
img.background_color = Color( 'skyblue' )
img.virtual_pixel = 'background'
angle = 90.0
img.distort( 'scale_rotate_translate' , (angle, ))
img.save(filename = "srtgfg.png" )
|
Output:
Example #2:
from wand.color import Color
from wand.image import Image
with Image(filename = 'gog.png' ) as img:
img.resize( 140 , 92 )
img.background_color = Color( 'skyblue' )
img.virtual_pixel = 'background'
angle = 90.0
scale = 0.5
img.distort( 'scale_rotate_translate' , (scale, angle, ))
img.save(filename = "srtgfg2.png" )
|
Output:
Share your thoughts in the comments
Please Login to comment...