Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display images dynamically with various colors

Status
Not open for further replies.

palchuri

Programmer
Apr 22, 2005
17
US
Hi All,
I don't know this is the right place to post this question. Here is my requirement.

We are building an application which supports multiple clients. In our application there are about 50-60 images.
As of now we are building all these images for each client because each client uses their own colors.This is becoming unmaintainable.

Is there any way to pass colors to an image dynamically so that it will display the image based on the inputted colors?

Thanks
Shri
 
If the images are all the same size and doing the same thing and only the color changes if you named the images something like

bottom_screen-clientcolor1.gif
bottom_screen-clientcolor2.gif
bottom_screen-clientcolor3.gif
bottom_screen-clientcolor4.gif
order_form_background-clientcolor1.gif
order_form_background-clientcolor2.gif
order_form_background-clientcolor3.gif
order_form_background-clientcolor4.gif
etc

I would think you could make a new set of images for each client that comes aboard and then call the appropriate image based on who was accessing the app. Stick all the images in a client directory and don't care if there are 60,000 images in there.

When client Smith accesses the app he gets served images in clientcolor3. When Jones comes in, she gets images in clientcolor12, etc. based on a login indentification variable.

I would do this server side with ASP but that is what I know how to do. I'm sure it is doable in javascript.

 
I don't think you understood my question correctly, May be I
haven't explained it correctly.

My requirement is to have a single GIF file which is common to all clients and should be able to pass colors to render the image. If I can do some how then I don't need to maintain multiple copies of the same image with different colors.

Requirement is to render the image by taking colors as input parameter?

Thanks
Shri
 
I understood what you were asking but I don't think you can do it is all. Maybe you can.

I was just suggesting an alternative. Namely that 60,000 copies of a little bitty gif web page image takes up a whole 2 megs of space maybe and it might be faster and easier to just have those gazillion images in good order and call the ones you want with some code, rather than having one set of images you try to modify on the fly.

I hope somebody else answers and tells you how to do what you want. Good luck.

 
I notice that you have asked 6 questions and haven't yet marked any answers as being valuable. If you haven't had any good answers take a look at faq222-2244. If you have had valuable answers see faq222-2244 to see how to acknowledge them.

For this question I can't see an immediate solution in javascript, but it may be possible to generate the files on the fly server side with the PHP image functions. Have a look at for some ideas

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top