`<picture>` lets you serve DIFFERENT images at different breakpoints — not just different sizes of the same crop. Perfect for a wide desktop banner that becomes a square mobile poster.
Let the browser pick the right image for the viewport. `srcset` lists candidates by intrinsic width; `sizes` tells the browser how big the image will render. Cuts mobile data dramatically.
Shrink an uploaded image so its longest side is no more than $maxDim pixels, preserving aspect ratio. Re-encodes to JPEG at the given quality. Uses the GD extension.