Pgmagick wave() 方法Python
wave()函数是 Pgmagick 库中的一个内置函数,用于随正弦波一起改变图像。该函数在成功时返回真值。
Syntax:
Parameters: This function accept two parameters as mentioned above and described below:
- amplitude: This parameter stores the value of the amplitude of the sine wave.
- wavelength: This parameter stores the value of the wavelength of the sine wave.
Return Value: This function returns the Pgmagick object with image added.
输入图像:
示例 1:
wave(amplitude, wavelength)
输出:
示例 2:
from pgmagick import Image, DrawableCircle, DrawableText
from pgmagick import Geometry, Color
# draw the image of dimension 600 * 600
img = Image('input.png')
# invoke wave function with amplitude 5 and wavelength 8
img.wave(5, 8)
# invoke write function along with filename
img.write('2_a.png')
输出:
在评论中写代码?请使用 ide.geeksforgeeks.org,生成链接并在此处分享链接。