GMImage.GetDensity
------------------

Queries the Vertical and horizontal resolution in pixels of the image.

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

MBS( "GMImage.GetDensity"; ImageRef ) 

**MBS**( **"GMImage.GetDensity";** /\* Queries the Vertical and horizontal resolution in pixels of the image. \*/  
**$ImageRef**) /\* The image reference number.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |

### Result

Returns a geomery as string.

### Description

Queries the Vertical and horizontal resolution in pixels of the image.  
See also [GMImage.GetResolutionUnits](GMImageGetResolutionUnits.md) for the unit.  
### Examples

Load image and get density:

 Set Variable \[ $image ; Value: MBS ( "[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; MediaField) \]  
Set Variable \[ $res ; Value: MBS ( "GMImage.GetDensity"; $image ) \]  
Set Variable \[ $r ; Value: MBS ( "[GMImage.Release](GMImageRelease.md)"; $image ) \]  
### See also

- [GMImage.GetDepth](GMImageGetDepth.md)
- [GMImage.GetEndian](GMImageGetEndian.md)
- [GMImage.GetHeight](GMImageGetHeight.md)
- [GMImage.GetQuality](GMImageGetQuality.md)
- [GMImage.GetResolutionUnits](GMImageGetResolutionUnits.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.NewFromContainer](GMImageNewFromContainer.md)
- [GMImage.Release](GMImageRelease.md)
- [GMImage.SetDensity](GMImageSetDensity.md)
- [GMImage.SetQuality](GMImageSetQuality.md)

### Example Databases

- [GraphicsMagick/Apply Mask](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Apply%20Mask.shtml#1ScriptAnchor_)

### Blog Entries

- [GraphicsMagick in FileMaker, part 2](https://www.mbsplugins.de/archive/2022-12-02/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 25th February 2026

  
[GMImage.GetDefineValue](GMImageGetDefineValue.md) - [GMImage.GetDepth](GMImageGetDepth.md)

[HTML Version](GMImageGetDensity.shtml)