# TinyPNG

TinyPNG uses smart lossy compression techniques to reduce the file size of your WebP, JPEG, and PNG files.

- **Category:** images & design
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 5
- **Triggers:** 0
- **Slug:** `TINYPNG`
- **Version:** 20260312_00

## Tools

### Get TinyPNG Compression Count

**Slug:** `TINYPNG_GET_COMPRESSION_COUNT`

Tool to retrieve the number of compressions made this month. Use when you need to monitor your TinyPNG API usage.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Shrink and get image ID

**Slug:** `TINYPNG_SHRINK_AND_GET_IMAGE_ID`

Tool to shrink an image and return its TinyPNG image ID. Use when you need only the compressed image identifier from the API response Location header.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `source_url` | string | Yes | Publicly accessible URL of the image to compress. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Compress and Store Image in Azure

**Slug:** `TINYPNG_TINIFY_COMPRESS_AND_STORE_IN_AZURE`

Compress an image using the Tinify API and upload the optimized result directly to Azure Blob Storage in a single operation. The image is first compressed by Tinify, then uploaded to the specified Azure Blob URL using the provided SAS token. Use this when you need to optimize images and store them in Azure without intermediate steps. Supports JPEG, PNG, and WebP image formats.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `source_url` | string | Yes | Publicly accessible URL of the source image to compress. Supports JPEG, PNG, and WebP formats. |
| `azure_blob_url` | string | Yes | Full Azure Blob Storage URL with a valid SAS (Shared Access Signature) token that has write permissions. The URL should include the target container, blob path, and SAS query parameters (sv, se, sr, sp, sig). Required SAS permissions: Write (w) and Create (c). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Download Compressed Image

**Slug:** `TINYPNG_TINIFY_OUTPUT`

Tool to retrieve a compressed image by its image ID. Use after compressing an image to download the result.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | Identifier for the uploaded and compressed image (returned by the TinyPNG shrink API). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Transform Compressed Image

**Slug:** `TINYPNG_TRANSFORM_IMAGE`

Tool to transform a compressed image by resizing, converting format, preserving metadata, or storing to cloud storage. Use when you have an image ID from a previous compression and need to apply transformations.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The unique identifier for the compressed image output, obtained from the Location header of the compress response. |
| `store` | string | No | Cloud storage options to save image directly to S3 or GCS. Each upload counts as additional compression. |
| `resize` | object | No | Options for resizing the image. |
| `convert` | object | No | Options for converting the image format. |
| `preserve` | array | No | Metadata to preserve: 'copyright', 'creation', 'location' (JPEG only). Does not count as additional compression. |
| `transform` | object | No | Transformation options for stylistic changes. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
