The first glyphs come from ancient Mesopotamia, from the Sumerian city of Kish. Although the idea of writing with pictures was invented in Mesopotamia it never caught on there. Instead the Mesopotamians developed a writing system based on symbols created from a series of wedge-shaped marks made in wet clay tablets. This is cuneiform writing.
The Ancient Egyptians were heavily influenced by Mesopotamia and frequently took their best ideas and made them better. This was the case with picture writing. The ancient Egyptians took the idea of using pictures to represent sounds and built their own written language around it.