Place newspaper or plastic around the perimeter of the carpet to protect the surrounding floor.
Lay down masking tape on the carpet to mark out the design that you want.
Paint the carpet using a paint roller that can fit in between whatever tape lines you've laid down. Start in the center of the carpet and work your way to the outside. Use a paint that is designed for outdoor applications, as it will be more durable. There are cloth paints available at craft stores as well.
Allow the paint to dry and then lift off the masking tape.