To create a perfect gem, add three flawless gems to the horadric cube.
To get a flawless gem, you need to use three regular gems.
To get three regular gems, you need to use three flawed gems.
To get three flawed gems, you need to use three chipped gems.
You can farm gems in Arcane Sanctuary.