In the manufacturing industry, spray painting is often an important part of the process. Especially in the automotive industry, the perceived quality of the final product is closely linked to the exactness and smoothness of the painting process. For complex products or low batch size production, manual spray painting is often used. But in large scale production with a high degree of automation, the painting is normally performed by industrial robots. There is a need to improve and simplify the generation of robot trajectories used in industrial paint booths. A method for spray paint optimization is presented, which can be used to smooth out an initial trajectory and minimize paint thickness deviations from a target thickness. By fitting a spline function to experimental data, an applicator footprint profile is determined, which is a two-dimensional reference function of the applied paint thickness. This footprint profile is then projected to the geometry and used as a deposition model at each point along the trajectory. The positions and durations of all trajectory segments are used as optimization variables. They are modified with the primary goal to obtain a paint applicator trajectory, which will closely match a target paint thickness when executed. The algorithm is shown to produce satisfactory results on both a simple 2-dimensional test example, and a nontrivial industrial case of painting a tractor render. The final trajectory shows an overall thickness close to the target thickness, and the resulting trajectory is feasible to execute directly on an industrial robot.