Convert Image to C Array for Hardware Displays
convert_image_to_c_arrayConvert images to C arrays for hardware displays like OLED or TFT. Supports monochrome, grayscale, and color formats with rotation and aspect settings.
Instructions
Convert images to C arrays for hardware displays (OLED, E-Paper, TFT, LEDs)
Supports: monochrome (1-bit), grayscale_2bit (4-level), grayscale_4bit (16-level), grayscale (8-bit), rgb565 (16-bit color), rgb888 (24-bit color)
Parameters:
rotation: 0, 90, 180, or 270 degrees (test all to find correct orientation)
threshold: Black/white cutoff for monochrome (e.g., "50%", "60%", "70%")
keep_aspect: True to maintain proportions, False to force exact size
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image_path": "<image_path>",
"width": "<width>",
"height": "<height>",
"var_name": "<var_name>"
},
"name": "convert_image_to_c_array"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image_path | Yes | ||
| width | Yes | ||
| height | Yes | ||
| var_name | Yes | ||
| format_type | No | monochrome | |
| output_file | No | ||
| invert | No | ||
| rotation | No | ||
| threshold | No | ||
| keep_aspect | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |