optimize background pattern