GMImage.WriteToWebPContainer
----------------------------

Writes the picture in WebP format to a container value which you can store in a container field.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [GraphicsMagick](component_GraphicsMagick.md) | [13.2](newinversion132.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "GMImage.WriteToWebPContainer"; ImageRef { ; FileName } ) 

**MBS**( **"GMImage.WriteToWebPContainer";** /\* Writes the picture in WebP format to a container value which you can store in a container field. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$FileName**) /\* Optional; The file name to use for the container.   
Default is "image.webp"e.g. "ball.webp" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| ImageRef | The image reference number. | 1 |  |
| FileName | The file name to use for the container.    Default is "image.webp" | "ball.webp" | Optional |

### Result

Returns a container value.

### Description

Writes the picture in WebP format to a container value which you can store in a container field.  
We store WebP as FILE containers, so no preview in FileMaker. We tried to include a preview JPEG, but FileMaker won't show it.  
  
See also [GMImage.WriteToFile](GMImageWriteToFile.md), [GMImage.WriteToJPEGContainer](GMImageWriteToJPEGContainer.md), [GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md), [GMImage.WriteToBMPContainer](GMImageWriteToBMPContainer.md) and [GMImage.WriteToGIFContainer](GMImageWriteToGIFContainer.md).  
### Examples

Convert to WebP:

 # Load from container   
Set Variable \[ $Image ; Value: MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; Image Scaling::InputImage ) \]   
If \[ MBS ("IsError") \]   
 Show Custom Dialog \[ "Error" ; $Image \]   
 Exit Script \[ Text Result: \]   
Else  
 # Write image to container and set the Information text   
 Set Field \[ Image Scaling::Result ; MBS ("GMImage.WriteToWebPContainer"; $Image ; "test.webp") \]   
 # Release image  
 Set Variable \[ $r ; Value: MBS ("[GMImage.Free](GMImageFree.md)";$Image ) \]   
End If  
### See also

- [GMImage.Free](GMImageFree.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.NewFromContainer](GMImageNewFromContainer.md)
- [GMImage.WriteToBMPContainer](GMImageWriteToBMPContainer.md)
- [GMImage.WriteToContainer](GMImageWriteToContainer.md)
- [GMImage.WriteToFile](GMImageWriteToFile.md)
- [GMImage.WriteToGIFContainer](GMImageWriteToGIFContainer.md)
- [GMImage.WriteToPDFContainer](GMImageWriteToPDFContainer.md)
- [GMImage.WriteToTiffContainer](GMImageWriteToTiffContainer.md)
- [IsError](IsError.md)

### Release notes

- **Version 13.2**
    - Added [GMImage.WriteToWebPContainer](https://www.mbsplugins.eu/GMImageWriteToWebPContainer.shtml) function.

### Blog Entries

- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.2pr1](https://www.mbsplugins.de/archive/2023-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 23th March 2023 , last changed 19th June 2026

  
[GMImage.WriteToTiffContainer](GMImageWriteToTiffContainer.md) - [GMImage.XResolution](GMImageXResolution.md)

[HTML Version](GMImageWriteToWebPContainer.shtml)