Wand function() function in Python
function() function is similar to evaluate function. In function() function pixel channels can be manipulated by applies a multi-argument function to pixel channels.
Following are the list of FUNCTION_TYPES in Wand:
- ‘undefined’
- ‘arcsin’
- ‘arctan’
- ‘polynomial’
- ‘sinusoid’
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Syntax :
wand.image.function(function, arguments, channel)Parameters :
Parameter Input Type Description function collections.abc.Sequence a sequence of doubles to apply against function arguments numbers.Real Number to calculate with operator
channel basestring Optional channel to apply operation on.
Example 1:
Source Image:

Python3
# Import Image from wand.image modulefrom wand.image import Imagefrequency = 3phase_shift = -90amplitude = 0.2bias = 0.7# Read image using Image functionwith Image(filename ="koala.jpeg") as img: # applying sinusoid FUCTION_TYPE img.function('sinusoid', [frequency, phase_shift, amplitude, bias]) img.save(filename ="kl-functioned.jpeg") |
Output :

Example 2:
Source Image:

Python3
# Import Image from wand.image modulefrom wand.image import Imagefrequency = 3phase_shift = -90amplitude = 0.2bias = 0.7# Read image using Image functionwith Image(filename ="road.jpeg") as img: # applying sinusoid FUCTION_TYPE img.function('polynomial', [frequency, phase_shift, amplitude, bias]) img.save(filename ="rd-functioned.jpeg") |
Output :



