One alternative approach would be to extract image data via AJAX as base64-based encoded png , and apply it to the element background-image property.
For instance:
$.get('/getmyimage', function(data) { // data contains base64 encoded image // for ex: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg== $('#yourElement').css('background-image', 'url("' + data + '")'); });
You will also need the server side of the script, which reads the image, converts it to png (and can cache it in base64) and returns the same.
source share