Prioritize the Existing Resolution First
JPG and WebP search their allowed quality range at the current dimensions. When that resolution cannot fit, proportional downscaling reduces the pixel count before a new search.
- Retains source proportions through required downscaling
- Uses the actual encoded size for the budget
- Keeps the chosen target available for revision