Switching and porting from Arduino Mega to Teensy 4.1

Those country flags look like a good place to start. Each flag could be stored as data in a separate file on an SD card with file names like "country16.dat" for Slovenia. The file could simply contain 3 bytes for each pixel in the matrix, i.e. 56 X ? X 3 bytes (the matrix height is -8? What does that mean?) and each 3 bytes represent the r, g, b values of that led. You could move the code above to another sketch which would render each flag in turn, then save each to the appropriate file name. Your main sketch could then simply read each file as required and display it.

Maybe other images that appear on the matrix could be stored in files this way too. Only one function would be needed to read any given file and display the image on the matrix.