How to Automate PNG Compression in Clay Workflows
Automating PNG compression in Clay workflows refers to using API actions to compress large screenshots and attachments before they are sent to prospects or stored in shared workspaces. This guide explains how to integrate TinyPNG and CloudConvert APIs into Clay tables, preventing email deliverability issues and reducing storage costs.
The Inefficiency of Raw Image Handling in Automated GTM Workflows
According to testing by Email on Acid, emails with a total size (including body content and attachments) under 100 KB achieve the highest deliverability, while messages exceeding this threshold face a progressive decline in deliverability. For sales teams running automated go-to-market (GTM) campaigns inside Clay, this 100 KB limit is a critical boundary that is easily violated by raw image assets.
B2B data enrichment pipelines frequently capture homepage screenshots, extract PDF portfolios, or download image attachments from lead lists. These raw files are almost always high-resolution PNGs, which commonly range from 2 MB to 5 MB in size. Sending these bulky attachments directly to prospects triggers spam filters, triggers bounce backs, and quickly fills up team inboxes.
Automating PNG compression in Clay workflows refers to using API actions to compress large screenshots and attachments before they are sent to prospects or stored in shared workspaces. Instead of relying on manual work or letting unoptimized assets clog your delivery pipelines, GTM engineers can automate the entire compression step directly inside their tables. This guide outlines how to build these programmatic compression pipelines using external APIs and how to store the resulting assets in shared, collaborative workspaces.
Why Programmatic Optimization Trumps Manual Compression for CRM Pipelines
Most guides on image optimization focus on manual drag-and-drop web interfaces, completely ignoring the needs of high-volume programmatic workflows. In a modern GTM system, a human marketer cannot manually download, compress, and re-upload hundreds of screenshots every day. The process must be entirely automated and integrated directly into the lead data pipeline.
Compressing PNGs can reduce file sizes by 70% without losing visual clarity, allowing you to maintain professional screenshots without the size penalty. For instance, a 3 MB homepage screenshot can be compressed to roughly 900 KB. This reduction is achieved through lossy compression techniques that discard redundant metadata and optimize color palettes without altering the visible elements of the screenshot.
Beyond email deliverability, file weight directly impacts operational costs in your storage and ingestion layers. In a collaborative platform like Fastio, credits meter the AI work (image ingestion, conversions, indexing, and chat), while storage and seats come with the plan. Smaller files mean less to ingest and convert, so compressing early in the pipeline lowers credit consumption and keeps you well inside your plan's storage allowance. This architectural optimization keeps your workspaces clean and cost-effective as your lead list grows into the tens of thousands.
Step-by-Step: Setting Up TinyPNG Compression inside a Clay Table
TinyPNG (via the Tinify API) offers a simple, developer-friendly endpoint for compressing images from a URL. By creating a custom HTTP request column in Clay, you can send your raw screenshot URLs to TinyPNG and write the compressed output back to your table.
To configure this pipeline, add a new HTTP Request column in your Clay table and enter the following settings:
Endpoint Configuration:
- Method: POST
- URL:
https://api.tinify.com/shrink - Headers:
Content-Type: application/json - Authentication: Basic Auth (Username:
api, Password:{{YOUR_TINYPNG_API_KEY}})
Next, define the request payload in the Body field. You will pass the column variable containing your raw screenshot URL:
{
"source": {
"url": "{{row.raw_screenshot_url}}"
}
}
Once you execute the request on a row, TinyPNG will process the image and return a JSON payload containing the metadata and the optimized file location. You can view their full payload structure in the Tinify developer portal.
{
"input": {
"size": 309503,
"type": "image/png"
},
"output": {
"size": 80459,
"type": "image/png",
"width": 800,
"height": 600,
"ratio": 0.2599,
"url": "https://api.tinify.com/output/examplehash"
}
}
To map the optimized image link back to your table, click on the Output column settings, navigate to the JSON response body, and select body.output.url to write the compressed image link to a new column. This column now holds a highly optimized, web-ready PNG that is ready for CRM syncing or outbound messaging.
Alternative Pipeline: Bulk Image Compression with the CloudConvert API
For teams that require more control over the compression engine or need to convert file formats during the optimization step, the CloudConvert API offers a powerful alternative. CloudConvert operates on a Job-based architecture, which chains tasks together to import, process, and export files.
To implement CloudConvert inside your Clay table, configure a new HTTP Request column with the following settings:
Endpoint Configuration:
- Method: POST
- URL:
https://api.cloudconvert.com/v2/jobs - Headers:
Authorization: Bearer {{YOUR_CLOUDCONVERT_API_KEY}}andContent-Type: application/json
The payload for CloudConvert must define three distinct tasks: importing the file from a URL, optimizing the PNG, and exporting the result. Enter the following JSON in the request body, which matches the schema for CloudConvert Jobs:
{
"tasks": {
"import-file": {
"operation": "import/url",
"url": "{{row.raw_screenshot_url}}"
},
"optimize-png": {
"operation": "optimize",
"input": "import-file",
"input_format": "png"
},
"export-png": {
"operation": "export/url",
"input": "optimize-png"
}
}
}
When the job completes, CloudConvert returns a JSON response containing the status of each task. You can map the final export URL by extracting body.tasks.export-png.result.files[0].url from the response. This URL points directly to the optimized PNG hosted on CloudConvert's servers, which can then be processed by downstream GTM applications.
Storing and Ingesting Optimized PNGs in Fastio Workspaces
Once your Clay table contains the optimized PNG URLs, you need a persistent storage layer to organize these assets and share them with clients.
While teams often look to legacy options first, traditional storage platforms introduce friction:
- Local Hard Drives: Cause version confusion and make collaborative file sharing difficult.
- Google Drive: Imposes strict API rate limits that break during bulk uploads, and lacks native webhooks for real-time automation.
- Amazon S3: Highly programmable but lacks a friendly human interface, forcing sales reps to download files locally just to view them.
Fastio resolves these problems by providing shared workspaces where humans and automated agents collaborate on the same files. GTM teams can use Fastio's REST API or native Model Context Protocol server to push compressed PNGs directly into a workspace folder. Fastio supports URL Import, which pulls files directly from a public URL in the cloud, completely bypassing local disk I/O.
Once the compressed PNG is stored in Fastio, enabling Intelligence Mode automatically indexes the asset. Although image chat is read-only, Ripley AI can parse and summarize file metadata, allowing team members to perform hybrid semantic searches across the workspace. Additionally, the workspace maintains a complete, append-only audit trail and per-file version history, ensuring that all agent modifications remain auditable.
If your workflow generates structured data (such as extracting pricing details or lead names from screenshots), you can use Metadata Views to automatically organize these details into a live queryable spreadsheet without templates or manual data entry. If the workspace is built by an agent for a client campaign, the agent can easily transfer organization ownership to a human stakeholder via a secure handoff link, keeping operations clean and compliant. For teams running automated workflows, Fastio provides dedicated storage for agents and human collaborators under their usage-based pricing plans.
Store compressed PNGs and GTM files in Fastio
Establish shared intelligent workspaces with native URL imports, built-in semantic search, and version history. Starts with a 14-day trial or a subscription.
Troubleshooting and Best Practices for Clay Image Optimization
Scaling a bulk compression pipeline inside Clay requires planning for API failures, rate limits, and credit consumption. If a target website is down or an image URL is broken, the compression API will return an error, which can halt downstream integrations.
To build a resilient workflow, implement the following best practices:
- Conditional Fallbacks: Use a formula column in Clay to check if the HTTP request was successful. If the request failed, configure the formula to fall back to the original, uncompressed image URL. This prevents broken image links from stopping your outbound campaigns.
- Rate Limit Management: Both TinyPNG and CloudConvert enforce rate limits on their API endpoints. When processing lists of several thousand leads, use Clay's built-in batching controls to run the enrichment columns in controlled waves rather than all at once.
- Credit and Cost Monitoring: Keep a close eye on API usage. TinyPNG provides 500 free compressions per month, after which pricing scales based on volume. On the Fastio side, compressing your PNGs by 70% means less data to ingest and convert, which lowers credit consumption and keeps long-term campaigns comfortably inside the plan's storage allowance.
By combining automated API compression inside Clay with Fastio's intelligent storage, you build a GTM data engine that is cost-effective and highly deliverable.
Frequently Asked Questions
How can I compress png files automatically?
You can compress PNG files automatically by setting up an HTTP Request enrichment column in your Clay table. This column sends the image URLs to external compression APIs like TinyPNG or CloudConvert, receives the optimized image URL, and writes it back to your table in real time.
Can Clay shrink image sizes?
Clay does not have a native image compression action, but it can shrink image sizes by integrating with external APIs. Using the HTTP Request tool, Clay sends the image URL to an optimization service and retrieves the compressed PNG link for your workflow.
Does image compression affect the quality of screenshots in outreach?
Lossy compression algorithms used by APIs like TinyPNG remove unnecessary metadata and redundant colors, reducing PNG file sizes by up to 70% without any perceptible loss in visual quality. The compressed screenshots remain clear and professional for prospects.
Related Resources
Store compressed PNGs and GTM files in Fastio
Establish shared intelligent workspaces with native URL imports, built-in semantic search, and version history. Starts with a 14-day trial or a subscription.