Skip to content
OpenSmartRoute
Skillv1.0.0

imgix

Optimize and transform images with imgix. Use when serving responsive images, implementing image CDN, adding real-time transformations, or optimizing Core Web Vitals with image delivery.

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/imgix/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill imgix. Copyright stays with the author (Apache-2.0).

imgix

Overview

imgix is a real-time image processing CDN. Point it at your image storage (S3, GCS, web folder), and it serves optimized, transformed images via URL parameters. No pre-processing needed — transformations happen on request and are cached globally.

Instructions

Step 1: URL API

// lib/imgix.ts — Image URL builder
import ImgixClient from '@imgix/js-core'

const client = new ImgixClient({
  domain: 'myapp.imgix.net',
  secureURLToken: process.env.IMGIX_TOKEN,    // sign URLs to prevent abuse
})

// Responsive image with auto format/quality
const url = client.buildURL('photos/hero.jpg', {
  w: 1200,
  h: 630,
  fit: 'crop',
  auto: 'format,compress',    // WebP/AVIF + quality optimization
  crop: 'faces',               // crop around detected faces
})

// Generate srcset for responsive images
const srcset = client.buildSrcSet('photos/hero.jpg', {
  auto: 'format,compress',
  fit: 'crop',
  ar: '16:9',
})

Step 2: React Component

import Imgix from 'react-imgix'

function ProductImage({ path, alt }: { path: string; alt: string }) {
  return (
    <Imgix
      src={`https://myapp.imgix.net/${path}`}
      sizes="(max-width: 768px) 100vw, 50vw"
      imgixParams={{
        auto: 'format,compress',
        fit: 'crop',
        ar: '1:1',
      }}
      htmlAttributes={{ alt, loading: 'lazy' }}
    />
  )
}

Step 3: Video Thumbnails

// Extract video thumbnails via URL
const thumbnail = client.buildURL('videos/demo.mp4', {
  fm: 'jpg',
  frame: 1,          // extract frame at 1 second
  w: 640,
  h: 360,
  fit: 'crop',
})

Guidelines

  • auto=format,compress delivers WebP/AVIF with optimal quality — always include it.
  • Sign URLs with secureURLToken in production — prevents parameter tampering.
  • imgix doesn't store images — it proxies from your origin (S3, GCS, HTTP).
  • Use buildSrcSet() for responsive images — generates proper srcset with widths.
  • Pricing: based on origin images accessed per month, not transformations.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-imgix/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-imgix.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-imgix",
  "kind": "skill",
  "name": "imgix",
  "description": "Optimize and transform images with imgix. Use when serving responsive images, implementing image CDN, adding real-time transformations, or optimizing Core Web Vitals with image delivery.",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "customer_support"
    ],
    "tags": [
      "skill-md",
      "imgix",
      "images",
      "cdn",
      "optimization",
      "responsive",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Optimize and transform images with imgix. Use when serving responsive images, implementing image CDN, adding real-time transformations, or optimizing Core Web Vitals with image delivery."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/imgix/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/imgix/SKILL.md",
      "key": "terminalskills/skills/skills/imgix/SKILL.md"
    },
    "compatibility": "Any web app, React, Next.js",
    "license": "Apache-2.0"
  },
  "instructions": "# imgix\n\n## Overview\n\nimgix is a real-time image processing CDN. Point it at your image storage (S3, GCS, web folder), and it serves optimized, transformed images via URL parameters. No pre-processing needed — transformations happen on request and are cached globally.\n\n## Instructions\n\n### Step 1: URL API\n\n```typescript\n// lib/imgix.ts — Image URL builder\nimport ImgixClient from '@imgix/js-core'\n\nconst client = new ImgixClient({\n  domain: 'myapp.imgix.net',\n  secureURLToken: process.env.IMGIX_TOKEN,    // sign URLs to prevent abuse\n})\n\n// Responsive image with auto format/quality\nconst url = c",
  "cost": {
    "context_tokens": 509
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-imgix/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.