🎥 Make videos programmatically with React
Docs: Add color correction guide
Jonny Burger25b8d7903c40
diff --git a/packages/docs/components/effects-demos/registry.ts b/packages/docs/components/effects-demos/registry.tsindex fc525bb864..cf08fbf9c5 100644--- a/packages/docs/components/effects-demos/registry.ts+++ b/packages/docs/components/effects-demos/registry.ts@@ -378,7 +378,10 @@ export const effectsDemos: EffectsDemoType[] = [effectName: 'lut',effectImportPath: '@remotion/effects/lut',comp: EffectsLutPreview,- schema: lut({content: LUT_PREVIEW_CONTENT}).definition.schema,+ schema: {+ ...lut({content: LUT_PREVIEW_CONTENT}).definition.schema,+ content: {type: 'hidden'},+ },initialValues: {content: LUT_PREVIEW_CONTENT,},diff --git a/packages/docs/docs/color-correction.mdx b/packages/docs/docs/color-correction.mdxnew file mode 100644index 0000000000..9e3a7938e6--- /dev/null+++ b/packages/docs/docs/color-correction.mdx@@ -0,0 +1,81 @@+---+image: /generated/articles-docs-color-correction.png+id: color-correction+title: Color correction+crumb: 'Designing visuals'+---++Color correction can adjust the exposure, contrast, color balance, and saturation of canvas-based content.++## Primary adjustments++Use [`colorCorrection()`](/docs/effects/color-correction) to combine common adjustments in one effect:++```tsx twoslash title="MyComp.tsx"+import {colorCorrection} from '@remotion/effects/color-correction';+import {Video} from '@remotion/media';++export const MyComp: React.FC = () => {+ return (+ <Video+ src="https://remotion.media/video.mp4"+ effects={[+ colorCorrection({+ exposure: 0.25,+ contrast: 1.1,+ temperature: 0.1,+ vibrance: 0.2,+ }),+ ]}+ />+ );+};+```++Individual effects such as [`brightness()`](/docs/effects/brightness), [`contrast()`](/docs/effects/contrast), and [`saturation()`](/docs/effects/saturation) are also available.++## LUTs++Use [`lut()`](/docs/effects/lut) to apply an existing 3D color grade in the `.cube` format.+Pass the file contents as a string:++```tsx twoslash title="MyComp.tsx"+import {lut} from '@remotion/effects/lut';+import {Video} from '@remotion/media';++const content = `+TITLE "Warm"+LUT_3D_SIZE 2++0 0 0+1 0.1 0+0 0.9 0.1+1 0.9 0.1+0 0.1 0.8+1 0.2 0.7+0 0.9 0.8+1 0.9 0.8+`;++export const MyComp: React.FC = () => {+ return (+ <Video+ src="https://remotion.media/video.mp4"+ effects={[lut({content})]}+ />+ );+};+```++If the LUT is hosted remotely, fetch its contents before rendering and pass the resulting string to `lut()`.++## Combining adjustments++Effects are applied in array order. Place `colorCorrection()` before `lut()` to make primary adjustments before applying the final grade.++## See also++- [Effects](/docs/effects)+- [`colorCorrection()`](/docs/effects/color-correction)+- [`lut()`](/docs/effects/lut)+- [Data fetching](/docs/data-fetching)diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.tsindex d8c3ec97a1..1af7797646 100644--- a/packages/docs/sidebars.ts+++ b/packages/docs/sidebars.ts@@ -1156,6 +1156,7 @@ const sidebars: SidebarsConfig = {'html-in-canvas','shaders','effects',+ 'color-correction','measuring','using-randomness','animation-math',diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex 52276daedd..65f089c886 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -1349,6 +1349,15 @@ export const articles = [noAi: false,slug: 'cloudrun/upgrading',},+ {+ id: 'color-correction',+ title: 'Color correction',+ relativePath: 'docs/color-correction.mdx',+ compId: 'articles-docs-color-correction',+ crumb: 'Designing visuals',+ noAi: false,+ slug: 'color-correction',+ },{id: 'compare-ssr',title: 'Comparison of server-side rendering options',diff --git a/packages/docs/static/generated/articles-docs-color-correction.png b/packages/docs/static/generated/articles-docs-color-correction.pngnew file mode 100644index 0000000000..d6184c166fBinary files /dev/null and b/packages/docs/static/generated/articles-docs-color-correction.png differ