user11450: I want to generate 16:9 thumbnails from videos with white padding but the resulting picture has grey padding instead of white. This is the command line (input here is a jpg but the effect is the same when using a video):
ffmpeg.exe -i "https://gooseberry.blender.org/wp-content/uploads/2014/01/franck.jpg" -filter_complex scale=iw*min(852/iw\,480/ih):ih*min(852/iw\,480/ih),pad=852:480:(852-iw*min(852/iw\,480/ih))/2:(480-ih*min(852/iw\,480/ih))/2:white,fps=fps=50/5.000000 output.jpg

the resulting image (text and white box added with paint): 

even though the padding color is white it's light grey in reality. Is there a way to get it 'whiter'? It's especially ugly if you plan to print it on paper. 

user1871: The end of the filter chain should output full RGB, like this:
Windows batch:
ffmpeg.exe -i "https://gooseberry.blender.org/wp-content/uploads/2014/01/franck.jpg" ^
  -filter_complex ^
   scale=iw*min(852/iw\,480/ih):ih*min(852/iw\,480/ih),^
pad=852:480:(852-iw*min(852/iw\,480/ih))/2:(480-ih*min(852/iw\,480/ih))/2:white,^
format=rgb24 franck-padded.jpg

Linux bash:
ffmpeg -i "https://gooseberry.blender.org/wp-content/uploads/2014/01/franck.jpg" \
  -filter_complex \
   "scale=iw*min(852/iw\,480/ih):ih*min(852/iw\,480/ih),\
pad=852:480:(852-iw*min(852/iw\,480/ih))/2:(480-ih*min(852/iw\,480/ih))/2:white,\
format=rgb24" franck-padded.jpg

The important part is format=rgb24 which keeps or converts the final filter output to the RGB pixel format, which allows full range values from 0-255. Without that final filter, ffmpeg will convert the filter output to the YUV pixel format where the range of legal values is 16 to 235 for luma (brightness) - 16 maps to black and 235 to white - and 16 to 240 for the chroma components (color). (The default YUV colorspace range is a legacy of analog television signals and carried over into the digital realm by the MPEG committee and hence still widely adhered to by most digital video formats)


11450: <p>I want to generate 16:9 thumbnails from videos with white padding but the resulting picture has grey padding instead of white. This is the command line (input here is a jpg but the effect is the same when using a video):</p>

<pre><code>ffmpeg.exe -i "https://gooseberry.blender.org/wp-content/uploads/2014/01/franck.jpg" -filter_complex scale=iw*min(852/iw\,480/ih):ih*min(852/iw\,480/ih),pad=852:480:(852-iw*min(852/iw\,480/ih))/2:(480-ih*min(852/iw\,480/ih))/2:white,fps=fps=50/5.000000 output.jpg
</code></pre>

<p>the resulting image (text and white box added with paint): 
<a href="https://i.stack.imgur.com/jNMQp.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/jNMQp.jpg" alt="enter image description here"></a></p>

<p>even though the padding color is white it's light grey in reality. Is there a way to get it 'whiter'? It's especially ugly if you plan to print it on paper. </p>
 1871: <p>The end of the filter chain should output full RGB, like this:</p>

<p>Windows batch:</p>

<pre class="lang-bash prettyprint-override"><code>ffmpeg.exe -i "https://gooseberry.blender.org/wp-content/uploads/2014/01/franck.jpg" ^
  -filter_complex ^
   scale=iw*min(852/iw\,480/ih):ih*min(852/iw\,480/ih),^
pad=852:480:(852-iw*min(852/iw\,480/ih))/2:(480-ih*min(852/iw\,480/ih))/2:white,^
format=rgb24 franck-padded.jpg
</code></pre>

<p>Linux bash:</p>

<pre class="lang-bash prettyprint-override"><code>ffmpeg -i "https://gooseberry.blender.org/wp-content/uploads/2014/01/franck.jpg" \
  -filter_complex \
   "scale=iw*min(852/iw\,480/ih):ih*min(852/iw\,480/ih),\
pad=852:480:(852-iw*min(852/iw\,480/ih))/2:(480-ih*min(852/iw\,480/ih))/2:white,\
format=rgb24" franck-padded.jpg
</code></pre>

<p>The important part is <strong>format=rgb24</strong> which keeps or converts the final filter output to the RGB pixel format, which allows full range values from 0-255. Without that final filter, ffmpeg will convert the filter output to the YUV pixel format where the range of legal values is 16 to 235 for luma (brightness) - 16 maps to black and 235 to white - and 16 to 240 for the chroma components (color). (The default YUV <a href="https://en.wikipedia.org/wiki/Color_space" rel="noreferrer">colorspace</a> range is a legacy of analog television signals and carried over into the digital realm by the MPEG committee and hence still widely adhered to by most digital video formats)</p>

<p><a href="https://i.stack.imgur.com/d66Dd.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/d66Dd.jpg" alt="enter image description here"></a></p>
