Understanding image resolution
A 4000 × 3000 picture contains 12 million pixel positions. That count describes the sampling grid. Lens focus, motion and compression determine how much useful detail the grid holds.
Separate shape from size
4000 × 3000 and 800 × 600 both have a 4:3 aspect ratio. The smaller version fits the same rectangular frame, but contains 25 times fewer pixels. Width and height each shrank by a factor of five. This is why a modest change to both dimensions can make a large difference to decoding memory.
Match source pixels to the display
A browser can display a 1600-pixel image in an 800 CSS-pixel slot. On a screen using two physical pixels per CSS pixel, that can preserve extra detail. On another layout the same source may be cropped, scaled down or shown full width. Inspect the destination before choosing export dimensions.
Know what enlargement can recover
Interpolation estimates additional pixels by looking at neighbors. It can smooth stair-stepped edges and produce a file with larger dimensions, but cannot recover a license plate or texture missing from the source. When possible, return to the camera original or rerender vector artwork at the required size.