Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Pixel format glitch art

Pixel format glitch art consists of forcing FFmpeg to perform an incorrect pixel format conversion.

Suppose we have <input.png> with whatever pixel format. We first tell FFmpeg to convert that file to an intermediate raw file with a specific pixel format:

<input.png> -> [yuv420p] <intermediate.raw>

and then we tell FFmpeg to treat the intermediate file as having some other pixel format, convert again to the intermediate pixel format, and save the output:

[nv12] <intermediate.raw> -> [yuv420p] -> <output.png>


First, edit the first lines in the script to specify where to find ffmpeg and ffprobe, the directory to put the output files, and the output file extension.

The script expects an input file and creates a makefile with all possible combinations of pixel format conversions. You should then run that makefile with -k, since some conversions will fail. Use as many cores as you can with -jN, where N is the number of cores.

$ python <input.png> > makefile
$ make -r -k -jN

It might be wise to remove all the duplicates afterwards (there will be a whole bunch of duplicates):

$ cd output_dir
$ fdupes --delete --noprompt .

Have fun

You now have a few gigabytes of corrupted images to play with. Have fun!


libcaca-logo gbrp12le->yuv420p10le gbrp9be->bgr48le gbrp9be->yuv422p10le gbrp->yuvj440p xyz12be->yuv420p10le yuv444p12le->yuv444p16be yuv444p16be->yuv420p14be yuva422p9be->yuv444p14le yuva422p9le->yuv420p16be yuvj444p->yuv420p12le

argb->argb bgr48be->yuv444p14be gbrp10be->xyz12le yuv444p16le->yuv422p12le yuv444p16le->yuv422p14le yuva444p->yuv422p12le

You can’t perform that action at this time.