Hacker News new | ask | show | jobs
by achtung82 2525 days ago
I would suspect the main reasons are the possibility to format images are greater for background-image than img. Functionality like background-size cover or contain in a background image are difficult to mimic with an img tag.
1 comments

But these features are meant for ornamental images, which should fit their container instead of being displayed "naturally". Stretching or cropping content images (instead of scaling and padding them, which is equally easy to do with proper and improper markup) is intrinsically inappropriate, not something worth doing.
I disagree. I would say cropping images is essential to be able to use images in responsive designs. It is obviously possible to make websites where images have the same aspect ratio on all devices, but in reality you dont always have the same people in charge of design as implementation.
In a responsive design, an image can be displayed with its proper aspect ratio, cropped as the author saw fit. It can be scaled to fill the available space horizontally or vertically, and it can be optionally optimized with a picture tag instead of a img tag to load a lightweight version if the available space is small.

Practical example: a group photo of 15 people smiling at the camera on the official page of some event. You adjust colour, you rotate the picture to get a horizontal horizon, you crop different amounts of excess background on each of the four sides. Then would you like "responsive" tricks to automatically slice away their feet because the screen isn't tall enough? Maybe their heads or a bit of both? Or should they be stretched instead, to disturbing squat proportions?

What kind of pictures look better deformed or mutilated than, at worst, unobtrusively letterboxed?

As i said before im not disputing that it is possible to make responsive design keep same aspect ratio always. Im just pointing out that in reality you can not control all parts of your work. Design as i said can be done by people you have no influence over. And they might have very relevant reasons for making it the way they do.

Obviously the ideal situation isnt to crop images, but if the people using the system is aware they can select images that do not have esential information in the edges.