PDA

View Full Version : Can I preload images with MultiFrame Image Slideshow



drewm88
07-10-2007, 05:49 PM
1) Script Title: MultiFrame Image Slideshow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/multiframeslide.htm

3) Describe problem:

Is it possible to preload images with this script?

jscheuer1
07-11-2007, 05:30 AM
Preloading isn't the solution to as many problems as one might think. However, any images may be set to be preloaded. One way with this script would be to add this code (red) as shown:


. . . city value of each image when it's "dimmed", and when it's not, respectively (1=100% opaque/normal).
//Change 0.2 to 0 to completely hide image when it's dimmed:
var opacityvalues=[0.2,1]

///No need to edit beyond here///////////

function preload_seqslides(){
var loadit=function(im){
var nimg=new Image();
nimg.src=im;
}
for (var i = 0; i < seqslides.length; i++)
loadit(seqslides[i][0]);
}
preload_seqslides();

function processimgcode(theimg){
var imghtml=""
if (thei . . .

drewm88
07-11-2007, 05:03 PM
The code worked great, thank you.
What problems with pre-loading are you alluding to? It has caused small white spots in my images, although not big or noticeable enough to be an issue. Is there a better way to go about it other than this pre-loading code?

jscheuer1
07-11-2007, 05:57 PM
I didn't say preloading caused problems. I said it doesn't always solve as many problems as one might think. An image cannot load any faster just because it is preloaded. So, if the image is large enough, it may still not be ready in time for its intended use. When this happens, the image behaves as though it wasn't preloaded, and perhaps even takes a little more time to load.

Those spots were, in all likelihood, either there before, and/or are as a result of processing the images in an image editor, or the default condition of the images. If the spots are what I think that they are, you need to set the images 'alpha black' to 0 in an image editor.

drewm88
07-11-2007, 06:33 PM
You're right. After changing the code, I looked at my page in IE for the first time since switching some pictures. FF doesn't have the white spots problem, so I hadn't noticed. I use Microsoft Office Picture Manager, would you happen to know how to change the alpha black setting in that? I can't find it. Thanks a lot.

jscheuer1
07-11-2007, 08:02 PM
Ooops, I was in kind of a rush, I should have said to adjust the 'true black'. I really don't know much about this except that there are other ways, but that if you can do it that way, it is the easiest. Here is a link to the basic info on 'true black' in Photoshop:

http://www.alexjudd.com/?p=5

I have Paint Shop and haven't been able to locate an equivalent setting in it yet, but I haven't checked through its many options exhaustively. As for other image processing programs, I wouldn't know for sure.

However, if you can find the offending pixel and change its color to 0,0,1 from 0,0,0 - that might be all you need to do. Or, perhaps using the color replace tool set to a large size, sweep over the entire image converting all 0,0,0 to 1,1,1 or some such near black value that isn't actually black.

What I used to do (this hasn't come up for me in some time), is to load up the image in Paint Shop and use the smudge retouch tool in and around the area of the offending pixel(s). This was a trial and error method that sometimes fixed the problem, sometimes didn't, and sometimes just moved the problem around. As long as I was willing to keep at it, eventually it would work. As I think about now, it probably worked when, and only when all offending pixels were changed in color so as not to be 0,0,0.

From the information on 'true black' in the above link, simply going to 0,0,1 may not be good enough, one may need to go all the way to 3,3,3 - but that is still indistinguishable from black to the human eye. However, if this is all that is at stake, the color value of the pixel, just 0,0,1 should do the trick.

Added Later: I played around with the newer ideas mentioned above, those relating to using a color replace tool. The results were less than I had hoped for. The problem doesn't appear to actually be full black (0,0,0) - but a range of colors near it. If these can be identified and changed to 0,0,0 in a particular image, this works. It is less 'hit or miss' than my smudging approach, but still tedious. With practice though, it could become routine and efficient.

If it is possible to give the image's containing element a dark or black color, that also takes care of it, but many fading slide shows cannot do this because they require that the images show partially through one another. If you have access to Photoshop, the 'true black' adjustment would seem to be, if it works as advertised, the easiest method.

Added Yet Later: I just discovered how to do this 'true black' adjustment in Paint Shop, which I have, as opposed to Photoshop, which I do not. I figured it out by going to the Photoshop web site (Adobe) and finding a screen shot of how the adjustment is done.

Basically, if your image editor has anything like this:

Colors > Adjust > Levels

open that up. Pick the RGB channel if it isn't already selected, and change the output 0 to 9 or to whatever number takes care of the problem. I tried various values with a particular image and 9 worked like a charm. It didn't take long to find it, much easier than any other method I've tried! It did make the image slightly lighter though.

Added Even Later:

From checking as best I could in a short time, it appears that Microsoft Office Picture Manager cannot make this color level adjustment, but I could be wrong. From what I can tell though, its features are fairly limited. You will probably need a program like Photoshop, Paint Shop Pro (the one I have), or something else that is also feature rich, like The Gimp (http://www.gimp.org/windows/) (freeware). There are probably many others. You may already have such a program and just not know it, or are just not all that familiar with it. Perhaps there is/are program(s) out there that is/are specifically designed to adjust color levels in images and does only that, but does it well.