Can I detect when a large preloaded image is not only loaded, but also fully visible?
<p>I'm developing an awesome feature that needs polishing, this question is a bit of a longshot but I'm curious to know whether what I want is even possible. </p>

<p>Here's the deal, a photo viewer:</p>

<p><a href="http://www.jungledragon.com/image/2748/fierce_crested_caracara.html/zoom" rel="nofollow">http://www.jungledragon.com/image/2748/fierce_crested_caracara.html/zoom</a></p>

<p>It works. Now I'm working on a new feature (not deployed in that example yet). It's an "HD" function. When clicked, it will switch the source of the big image on screen to the <strong>original format</strong>. That means the image source will be replaced with the image as it was uploaded, which means a very high resolution and file size.  The result is ultra crisp photo viewing, even on large monitors and TVs. </p>

<p>Here's the preloading part of my code:</p>

<pre><code>$("#HD").live('click', function(e) {
    var imageID = $("#bigimage img").attr('id');

    $.post(basepath + 'image/' + imageID + '/hd',function(data) {
        var imagePreloader = new Image();
        imagePreloader.src = data;
        $(imagePreloader).imagesLoaded(function() {
            var img = $("#bigimage img");

            // set the image src, this effectively shows the image
            img.attr({ src: data });
        });
    });

    e.preventDefault();
});
</code></pre>

<p>This code will first retrieve the URL of the original image, which is protected. Next, it will preload that image and when done, adjust the source of the big image to replace it with the original size image URL.</p>

<p>All of this works fine. The problem is that once the image is loaded and I set the new src attribute, the actual "drawing" of the image on screen takes several seconds. You can see it vertically building up pixels. I rather have the lesser image in place to be replaced with the high res one in a big bang rather than this progressive rendering. </p>

<p><strong>Is it possible to detect when an image is not only loaded, but also rendered?</strong></p>

<p><strong>Update:</strong> Did some browser testing and noticed the issue of the image "building" up only occurs in Firefox (currently using 8.0), but not in Chrome, Safari, Opera or even IE9. This reduces my problem to FF only so it seems.</p>
