---
title: "A journey through color space with FFmpeg - Canva Engineering Blog"
description: "Canva video exports looked less saturated than the editor because of color space mismatches when converting RGB slide images into Rec."
url: "https://swe.quest/articles/a-journey-through-color-space-with-ffmpeg-canva-engineering-blog-af8de389891dbead"
canonical: "https://www.canva.dev/blog/engineering/a-journey-through-colour-space-with-ffmpeg/"
source: "Canva Engineering"
published: "2023-04-17"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 35
tags: ["video-media","debugging"]
---

# A journey through color space with FFmpeg - Canva Engineering Blog

A post on [Canva Engineering](https://swe.quest/sources/canva.md), published 2023-04-17, 35 min read, Deep dive. Original: [https://www.canva.dev/blog/engineering/a-journey-through-colour-space-with-ffmpeg/](https://www.canva.dev/blog/engineering/a-journey-through-colour-space-with-ffmpeg/)

## Summary

Canva video exports looked less saturated than the editor because of color space mismatches when converting RGB slide images into Rec. 709 video with FFmpeg. The explanation builds from human vision (cone sensitivity, nonlinear brightness perception, higher resolution for luminance than chroma) through CIE 1931 XYZ, primaries, white points, gamma correction and chroma subsampling. It then walks through FFmpeg's colorspace filter and flags such as -colorspace, -color\_primaries and -color\_trc to show what each parameter does and how to transform images into correctly tagged Rec. 709 output.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Video & media](https://swe.quest/tags/video-media.md) (Domains)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)

## Prerequisites

- RGB pixel representation
- basic video encoding ([easy posts on Video & media](https://swe.quest/tags/video-media.md?difficulty=easy))
- FFmpeg command line

## Keywords

FFmpeg, Rec. 709, CIE 1931, CIE XYZ, BT.601, YUV420p, gamma correction, D65

## Related posts

- [Wide Gamut 2D Graphics using HTML Canvas](https://swe.quest/articles/wide-gamut-2d-graphics-using-html-canvas-c32c74a661ded0f9.md): WebKit · 2021-12-14 · Medium · 9 min read · Browsers, Frontend, JavaScript
  WebKit now supports Display P3 color spaces for 2D canvas via getContext("2d", { colorSpace: "display-p3" }), so fills, strokes, gradients, shadows and text can use wide gamut CSS colors.
- [Bringing HDR video to Reels](https://swe.quest/articles/bringing-hdr-video-to-reels-29eb6ac55a3191a2.md): Meta Engineering · 2023-07-17 · Medium · 9 min read · Video & media, Mobile
  Facebook and Instagram Reels now accept HDR uploads from phone camera rolls and play them back in full HDR, which required handling HLG and PQ formats across a fragmented device landscape.
- [Add wide gamut P3 and alpha transparency to your color picker in HTML](https://swe.quest/articles/add-wide-gamut-p3-and-alpha-transparency-to-your-color-picker-in-html-2bf169620936554b.md): WebKit · 2025-05-07 · Medium · 4 min read · Browsers, Frontend, CSS
  \`\<input type="color"\>\` now supports two new optional attributes, \`alpha\` and \`colorspace\`, added to the HTML standard with WHATWG and first shipped in Safari 18.4.
- [Multi‑Ratio Video Resizing for Mobile Feed and Marketing](https://swe.quest/articles/multi-ratio-video-resizing-for-mobile-feed-and-marketing-5ad890c1fea2e907.md): Netflix TechBlog · 2026-10-26 · Easy · 4 min read · Video & media, Computer vision
  Netflix automatically reframes 16:9 footage into 9:16, 4:5 and 1:1 crops with a "virtual camera" pipeline built in three stages.
- [Building Background Effects for Clips](https://swe.quest/articles/building-background-effects-for-clips-cb745a4b3f0b9f4c.md): Slack Engineering · 2022-06-07 · Medium · 6 min read · Computer vision, Video & media, WebAssembly, Browsers, Performance engineering
  Slack's Clips background blur and image replacement run as a browser and desktop pipeline.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
