Were soldiers like the finely dressed Jannisaries or colorful French Musketeers really dressed fancy, or is this more akin to making soldiers prettier to look at for the paintings.
If they really did wear such fancy clothing, was it for identification purposes? Or morale purposes?
Artists who do not travel with armies or have the chance to see one in a situation other than a parade may improperly display soldiers in battle. For example, many artists during the american civil war will draw every soldier with their knapsack (backpack) on and sometimes wearing gaiters, purely because thats what they saw when a regiment marched out of a city or in a parade. However in actual battle knapsacks were dropped before going in and gaiters were thrown away by most soldiers to begin with as they were very disliked.
But for the most part, uniforms in art are pretty accurate. They did indeed wear such fancy uniforms back then, and for a variety of reasons. A large one is these complex uniforms make distinguishing a friendly soldier from an enemy easy in battle. Though complex uniforms may be especially fancy for prestige reasons, such as the Imperial Guard of Napoleon or the Russian Leib Guard.