With my web application, I have an image that changes in sizes as it calls a different image from the database each time it is viewed. My goal is to make sure this image is displayed responsively on different devices. For smartphones, I want the image to fit the screen but be slightly smaller, leaving around 30% of the screen for text and taking up 70% for the image.
The application is already developed and the image is integrated, but I want to ensure that all image sizes are displayed correctly on various browsers – both mobile and desktop ones.
How can I scale the image so that regardless of the device or the size of the image being called, it will fit the screen at around 70% on smaller devices and maintain its normal size on desktop or tablet views? If the image is too large, I also want it to be scaled down in other views.
Should I consider using ImageMagick, picturefill, CSS, JavaScript (jQuery, CoffeeScript, Bootstrap), or can I handle it with plain HTML5? Is there any advanced technique like canvas that I should incorporate?