The imagewbmp() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser and convert any other image type to WBMP.
bool imagewbmp( resource $image, int $to, int $foreground )
Parameters: This function accept three parameters as mentioned above and described below:
- $image: It specifies the image resource file to perform operation.
- $to (Optional): It specifies the path to save the file.
- $foreground (Optional): It specifies the foreground of the image.
Return Value: This function returns TRUE on success or FALSE on error.
Below examples illustrate the imagewbmp() function in PHP:
Example 1: In this example we will be downloading an image in browser.
This will download your image as download, further you can rename this file to anything like geeksforgeeks.wbmp and use it.
Example 2: In this example we will convert PNG into WBMP.
This will save the WBMP version of image in the same folder where your PHP script exist.
- How to get the function name inside a function in PHP ?
- D3.js | d3.mean() function
- p5.js | sin() function
- p5.js | cos() function
- p5.js | log() function
- D3.js | d3.set.has() Function
- PHP | ord() Function
- p5.js | tan() function
- PHP | dir() Function
- p5.js | str() function
- PHP | pow( ) Function
- CSS | var() Function
- p5.js | int() function
- D3.js now() function
- p5.js | hex() function
- D3.js | d3.map.set() Function
- D3.js | d3.sum() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.