Electrophotography principles and optimization