Any way to get background color info using JavaScript?

I know you can get a GIF's height and width, but I'm
wondering if there's anyway to retrieve its background
color. From what I understand, it's stored in the GIF
header right along with the height & width information,
so I'm curious if it's possible.

Failing that, is there anyway to dynamically rename a
GIF to a different file. In other words, can you change
the name of "image.gif" to "image.txt" somehow? If
so, you could just pull in the text file and read the
background color info. But I can't figure out how to do
that either!

Any suggestions are welcome
sleepybearAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sleepybearAuthor Commented:
Oops. I suppose I should have mentioned that I meant to
add... "any way to do this in JavaScript?"

Hopefully, since this IS in the JavasScript section you guys
figured that out.
0
GwynforWebCommented:
not client side. The only things exposed off the header of an image file to JS are the heigth and width. see http://www.devguru.com/Technologies/ecmascript/quickref/image.html

You can not change the extension using JS programatically
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GwynforWebCommented:
     You have access to 4 bytes of info in the header (ie height and width) this is 32 bits. By limiting your chars to alpha-numeric and a just a few special chars with  compression you can get it down to between 4 and 5 bits per char (if you are really smart with the compression depending on the message type you could even get this down lower). Bascially you are looking at about 6 or 7 chars per header, this is not a lot and you would require about  40 images for 256 chars.

   
0
GwynforWebCommented:
the width and height in the header can be edited with a hex editor on say with a 3 by 3 .bmp to be 63000 by 45987 and the file will still be tiny, the file can be loaded and not displayed with the data extracted, I tried it.  But still not much data per image.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.