In this paper we provide an optimal estimate for the operator norm of time-frequency localization operators L-F,L-phi: L-2(R-d) -> L-2(R-d), with Gaussian window phi and weight F, under the assumption that F is an element of L-p(R-2d) boolean AND L-q(R-2d) for some p and q in (1, +infinity). We are also able to characterize optimal weight functions, whose shape turns out to depend on the ratio parallel to F parallel to(q)/parallel to F parallel to(p). Roughly speaking, if this ratio is "sufficiently large" or "sufficiently small" optimal weight functions are certain Gaussians, while if it is in the intermediate regime the optimal functions are no longer Gaussians. As an application, we extend Lieb's uncertainty inequality to the space L-p + L-q. (c) 2024 Elsevier Inc. All rights are reserved, including those for text and data mining, AI training, and similar technologies.