function() function is similar to evaluate function. In function() function pixel channels can be manipulated by applis a multi-argument function to pixel channels.
Following are the list of FUNCTION_TYPES in Wand:
- ‘undefined’
- ‘arcsin’
- ‘arctan’
- ‘polynomial’
- ‘sinusoid’
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:

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

Example 2:
Sorce Image:

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

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.
Recommended Posts:
- Wand selective_blur() function in Wand python
- Python - Read blob object in python using wand library
- Wand image - Baseimage.kuwahara() function in Python
- Wand image.edge function in Python
- Wand gaussian_blur() function in Python
- Wand transform() function in Python
- Wand crop() function in Python
- Wand rotational_blur() function in Python
- Wand - blur() function in Python
- Python - Image() function in Wand
- Python - clone() function in wand library
- Python - shade() function in Wand
- Python - sharpen() function in Wand
- Wand adaptive_sharpen() function in Python
- Python - noise() function in Wand
- Python - blue_shift() function in Wand
- Python - color_matrix() function in Wand
- Wand unsharp_mask() function - Python
- Wand colorize() function - Python
- Wand fx() function - Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

