# dxGetPixelsFormat (Client)

> Detects the format of an image held in a string.

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

## Syntax

```lua
string|false dxGetPixelsFormat(string pixels)
```

## Parameters

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

## Returns

`plain`, `png`, `jpeg` or `dds`, or `false` when it was not recognised.

## Example

```lua
local file = fileOpen("images/photo.jpg", true)
local pixels = fileRead(file, fileGetSize(file))
fileClose(file)
print(dxGetPixelsFormat(pixels))
```

## See also

- [dxGetPixelsSize (Client)](https://wiki.mymp.gg/en/dxGetPixelsSize.md): Returns the width and height of an image held in a string (plain, png, jpeg or dds).
- [dxConvertPixels (Client)](https://wiki.mymp.gg/en/dxConvertPixels.md): Converts an image held in a string to another format, in the background, and hands the result to a function.
