How I Built a Free Image Optimization API (with WordPress Plugin Integration)


Modern websites live and die by performance. Large, unoptimized images are still one of the biggest reasons pages load slowly — especially on eCommerce and WordPress sites.

That’s why I built TinySharp, a free image optimizer that comes with:

🌐 API access (beta) — for developers who want to integrate image compression directly into their workflow.

🔌 WordPress plugin — so site owners can bulk-optimize their Media Library without leaving the dashboard.

🛠️ Free web tools — quick drag-and-drop optimizers for everyday use.

Example: Using the TinySharp API with Node.js

Here’s a minimal snippet showing how you can send an image to the API and get a compressed WebP version back:

import fetch from “node-fetch”;
import fs from “fs”;

async function optimizeImage() {
const res = await fetch(“https://api.tinysharp.com/optimize“, {
method: “POST”,
headers: { “Authorization”: “Bearer YOUR_API_KEY” },
body: JSON.stringify({
url: “https://example.com/image.jpg“,
format: “webp”,
quality: 80
})
});

const buffer = await res.arrayBuffer();
fs.writeFileSync(“optimized.webp”, Buffer.from(buffer));
}

optimizeImage();

This snippet fetches a remote image, compresses it via TinySharp, and saves it locally as WebP.

Why I Open-Sourced a Free Optimizer

There are paid tools out there (TinyPNG, Cloudinary, etc.), but I wanted to create something developer-friendly, free to start, and with WordPress support out of the box.

⚡ Results: Reduce images from 1.5 MB → a few KB without visible quality loss.

📦 Integration: WordPress plugin for non-tech users.

🔑 API: Simple JSON interface for devs.
Try the free audit tool → TinySharp Audit

Install the WordPress plugin (beta)

Or play with the API directly (docs + Postman collection included)

Would love feedback from other devs — what integrations would you find most useful? (Next.js, Gatsby, Shopify, something else?)



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *