On Google there is a Photo for reference :
https://support.google.com/photos/answer/6220791?h...
The choice of the size of the saved photos and videos
You can choose the size of photos and videos uploaded to Google Photos library, or free space in Google Drive.
On your computer, open the page photos.google.com/settings.
Select one of the options: high quality or original size.
"High quality"
You can store unlimited number of files.
The photos are compressed to save space. If the photo resolution exceeds 16 m., it will be reduced to this value.
This is enough to print photos in the size 61x40,6 see
If the video resolution exceeds 1080p, it will be reduced to this value. If the video resolution does not exceed 1080p, the saved file the quality will not be inferior to the original
Same goes for Google Drive - Google shakes some file formats that they do not take up much space on the servers.
https://support.google.com/docs/answer/6055139?hl=...
The same technology applies and Yandex.
Compression is the conversion, which allows you to then "expand" the image or document.
If the question relates to search Engines, neither Google nor Yandex — don't keep anything, but only displays the URL links to images.