is there any possibility to change an image’s resolution on clientside (using CSS, Javascript, whatever) but keep it’s size on the screen?
Example: I want to dispaly a 1920×1080 image with a resolution of 20×10 at a size of 200×100. Just using a img element, set it’s source and width/height to 20×10 surely works, but now I’d like to display the scaled image at a size of 200×100.
Is that somehow possible without generating a new image on server-side?
You can do this using HTML5 canvas:
Given an original image of any size that you want to give a size of
200x200and a resolution of50x50:50x5050200x200.Like this: http://jsfiddle.net/eGjak/234/.
As a side note, HTML5 canvas uses anti-aliasing in all browsers as far as I’m concerned, with no ability to turn that off. So instead of pixelated results you’ll have blurry results.