Choose output dimensions from the intended display or print size. Keep aspect ratio to avoid stretching. With both width and height set, the image fits inside that box; it is not cropped to fill it. Enlarging pixels does not create missing detail.
How to Optimize Images for SEO
Image optimization supports accessibility and loading performance. Ranking gains cannot be promised.