xiaohongshu
xiaohongshu
imgix
Optimizes and transforms images with Imgix CDN using URL-based API. Use when serving responsive images, applying real-time transformations, and optimizing delivery without processing overhead.
Full skill instructions
Real-time image processing and CDN delivery via URL parameters. No server-side processing needed - transformations happen at the edge.
https://your-source.imgix.net/path/to/image.jpg?w=400&h=300&fit=crop
Components:
const imgixDomain = 'your-source.imgix.net';
function imgixUrl(path, params = {}) {
const url = new URL(`https://${imgixDomain}${path}`);
Object.entries(params).forEach(([key, value]) => {
url.searchParams.set(key, value);
});
return url.toString();
}
// Usage
const url = imgixUrl('/products/shoe.jpg', {
w: 400,
h: 300,
fit: 'crop',
auto: 'format,compress',
});
// https://your-source.imgix.net/products/shoe.jpg?w=400&h=300&fit=crop&auto=format%2Ccompress
?w=400 # Width
?h=300 # Height
?w=400&h=300 # Both (may crop/letterbox based on fit)
?ar=16:9&w=800 # Aspect ratio with width
?fit=clip # Resize to fit, no crop (default)
?fit=crop # Resize and crop to exact size
?fit=fill # Resize to fit, fill with background
?fit=fillmax # Like fill, never upscale
?fit=max # Resize to fit, never upscale
?fit=min # Resize, at least one dimension matches
?fit=scale # Stretch to exact size (distorts)
?fit=clamp # Like clip, never upscale
?fit=facearea # Crop to detected face
?crop=faces # Crop to faces
?crop=entropy # Crop to high-detail area
?crop=edges # Crop to edges
?crop=top # Crop from top
?crop=bottom,left # Crop from bottom-left
# Focal point (0-1 coordinates)
?fp-x=0.3&fp-y=0.7&fit=crop
# Face detection + crop
?fit=facearea&facepad=1.5
?auto=format # Best format for browser (WebP, AVIF)
?auto=compress # Optimal compression
?auto=format,compress # Both (recommended)
This automatically:
?q=75 # Quality 1-100 (default varies by format)
?fm=webp # Force WebP format
?fm=avif # Force AVIF format
?fm=jpg # Force JPEG
?fm=png # Force PNG
?lossless=true # Lossless compression (PNG, WebP)
?bri=20 # Brightness (-100 to 100)
?con=30 # Contrast (-100 to 100)
?sat=50 # Saturation (-100 to 100)
?hue=180 # Hue rotation (0-359)
?gam=1.5 # Gamma (0-10)
?exp=10 # Exposure (-100 to 100)
?vib=20 # Vibrance (-100 to 100)
?blur=50 # Gaussian blur (0-2000)
?sharp=10 # Sharpen (0-100)
?sepia=80 # Sepia tone (0-100)
?monochrome=blue # Monochrome with tint
?htn=0 # Halftone
?px=10 # Pixelate
?duotone=000000,663399 # Duotone (shadow,highlight)
?blend=663399&bm=multiply # Color blend
# Image overlay
?mark=watermark.png&mark-w=100&mark-align=bottom,right&mark-pad=10
# Text overlay
?txt=Hello%20World&txt-size=24&txt-color=ffffff&txt-align=center
?txt=Copyright&txt-font=Helvetica&txt-pad=20
# Blend modes
?blend=overlay.png&bm=multiply&ba=center,middle
function generateSrcset(path, sizes = [400, 800, 1200, 1600]) {
return sizes
.map((w) => `${imgixUrl(path, { w, auto: 'format,compress' })} ${w}w`)
.join(', ');
}
// Usage in React
function ResponsiveImage({ src, alt, sizes }) {
return (
<img
src={imgixUrl(src, { w: 800, auto: 'format,compress' })}
srcSet={generateSrcset(src)}
sizes={sizes}
alt={alt}
/>
);
}
?w=400&dpr=2 # 800px actual, for 2x displays
?w=400&dpr=3 # 1200px actual, for 3x displays
function generateDprSrcset(path, width) {
return [1, 1.5, 2, 3]
.map((dpr) => `${imgixUrl(path, { w: width, dpr, auto: 'format,compress' })} ${dpr}x`)
.join(', ');
}
npm install @imgix/js-core
import ImgixClient from '@imgix/js-core';
const client = new ImgixClient({
domain: 'your-source.imgix.net',
secureURLToken: 'your-token', // Optional, for signed URLs
});
// Build URL
const url = client.buildURL('/image.jpg', {
w: 400,
h: 300,
fit: 'crop',
auto: 'format,compress',
});
// Generate srcset
const srcset = client.buildSrcSet('/image.jpg', {
auto: 'format,compress',
}, {
widths: [400, 800, 1200, 1600],
});
npm install @imgix/react
import Imgix from '@imgix/react';
function ProductImage({ path }) {
return (
<Imgix
src={`https://your-source.imgix.net${path}`}
sizes="(min-width: 1024px) 50vw, 100vw"
imgixParams={{
fit: 'crop',
ar: '16:9',
auto: 'format,compress',
}}
htmlAttributes={{
alt: 'Product image',
loading: 'lazy',
}}
/>
);
}
import { Background } from '@imgix/react';
function Hero({ imagePath }) {
return (
<Background
src={`https://your-source.imgix.net${imagePath}`}
imgixParams={{ auto: 'format,compress', fit: 'crop' }}
className="hero-section"
>
<h1>Welcome</h1>
</Background>
);
}
// next.config.js
module.exports = {
images: {
loader: 'custom',
loaderFile: './imgix-loader.js',
},
};
// imgix-loader.js
export default function imgixLoader({ src, width, quality }) {
const url = new URL(`https://your-source.imgix.net${src}`);
url.searchParams.set('w', width.toString());
url.searchParams.set('q', (quality || 75).toString());
url.searchParams.set('auto', 'format,compress');
return url.toString();
}
import Image from 'next/image';
function ProductImage({ src }) {
return (
<Image
src={src}
width={800}
height={600}
alt="Product"
/>
);
}
?w=150&h=150&fit=crop&crop=faces&auto=format,compress
?w=1920&h=600&fit=crop&crop=entropy&auto=format,compress&q=80
?w=100&h=100&fit=facearea&facepad=2&mask=ellipse&auto=format,compress
?w=400&h=300&fit=crop&ar=4:3&auto=format,compress
?w=800&fit=max&auto=format,compress&bg=ffffff
?w=20&blur=200&auto=format,compress&q=30
For private images or to prevent URL tampering:
import ImgixClient from '@imgix/js-core';
const client = new ImgixClient({
domain: 'your-source.imgix.net',
secureURLToken: process.env.IMGIX_SECURE_TOKEN,
});
// Signed URL
const signedUrl = client.buildURL('/private/image.jpg', {
w: 400,
auto: 'format,compress',
});
auto=format,compress - Let imgix choose best formatdpr for high-density displaysImgix charges based on:
Use consistent transformation parameters to maximize cache hits.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience