# dxGetPixelsSize (Client)

> Returns the width and height of an image held in a string (`plain`, `png`, `jpeg` or `dds`).

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Screen drawing
- **URL**: https://wiki.mymp.gg/en/dxGetPixelsSize

## Syntax

```lua
int, int|false dxGetPixelsSize(string pixels)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `pixels` | `string` | The pixels. |

## Returns

The width and the height, or `false` when the format was not recognised.

## Example

```lua
local file = fileOpen("images/photo.png", true)
local pixels = fileRead(file, fileGetSize(file))
fileClose(file)
local w, h = dxGetPixelsSize(pixels)
```

## See also

- [dxGetPixelsFormat (Client)](https://wiki.mymp.gg/en/dxGetPixelsFormat.md): Detects the format of an image held in a string.
- [dxGetTexturePixels (Client)](https://wiki.mymp.gg/en/dxGetTexturePixels.md): Reads an image's pixels and hands them to a function, a few frames later.
- [dxGetPixelColor (Client)](https://wiki.mymp.gg/en/dxGetPixelColor.md): Reads the colour of one pixel of a plain image.
