performance adaption to foregroundimage, menu optimization