In a paper I read, the authors selected various images by color, and I wondered if what they did wouldn’t be better expressed by according to color. But the longer I thought about it, the less sure I was. Maybe someone here can help my muddled brain.
Since by has a sense "according to", the meaning is the same.
The second is longer, and more cumbersome. That's not a difference in meaning, but it is a practical reason to favour the first.
Now, if a given use of by in this sense was open to misinterpretation to any of the other senses of by, that would be a reason to favour the latter. But since that seems unlikely, I'd go for the first.