Triim for developers
Triim's image tools are available as three open-source (MIT) packages: triim-js for web apps, the triim command-line tool, and triim-mcp, an MCP server that lets AI agents like Claude and Cursor run the tools on local files. Everything runs on your machine and nothing is uploaded.
Built by Rocco Bombardieri. Source on GitHub.
How do I install Triim today?
The npm packages are coming soon. Until they are published, build from source (Node.js 20 or newer):
git clone https://github.com/RoccoBMB/Triim.git
cd Triim
npm ci
npm run build -w triim
npm run build -w triim-mcpHow can an AI agent use Triim?
Install the MCP server and the agent gets five tools: trim_transparent_pixels, square_image, resize_image, convert_image and remove_solid_background. Each takes absolute file paths, writes new files without overwriting the originals, and returns the output paths with before and after dimensions and byte sizes so the agent can check its own work.
Claude Code
claude mcp add triim -- node /absolute/path/to/Triim/packages/triim-mcp/dist/index.jsClaude Desktop and Cursor
Add this to claude_desktop_config.json (Claude Desktop) or ~/.cursor/mcp.json (Cursor):
{
"mcpServers": {
"triim": {
"command": "node",
"args": ["/absolute/path/to/Triim/packages/triim-mcp/dist/index.js"]
}
}
}Can I run Triim from the command line?
Yes. triim needs Node.js 20 or newer and works on files or simple patterns. It writes new files next to the originals and only replaces them if you pass --in-place.
node packages/triim-cli/dist/cli.js trim logo.png
node packages/triim-cli/dist/cli.js square photo.jpg --size 1080 --background white
node packages/triim-cli/dist/cli.js resize hero.png --width 1200
node packages/triim-cli/dist/cli.js convert *.png --to webp --quality 82
node packages/triim-cli/dist/cli.js remove-bg product.png --tolerance 30Can I use Triim inside a web app?
triim-js is the same library that powers this site. It takes a File and returns a Blob using only the Canvas API, with no runtime dependencies.
// npm release coming soon; source in packages/triim-js
import { trimImageInBrowser } from 'triim-js';
const { blob, name, width, height } = await trimImageInBrowser(file);Why local-only?
Images stay on your device or your own disk, so there is no upload, account, API key or rate limit. Output is deterministic. Background removal is a fixed color-key algorithm: it works well on clean backdrops, logos and product shots, and it is not an AI cutout for complex scenes. The no-install versions of these tools live at trim, square, resize, convert and remove background.