Page 1 of 1
Bytes to bits in for graphics processing
Posted: Wed Jun 27, 2007 4:45 pm
by superdezign
In order to process an *.ico image into a different format, I ifrst have to be able to get each bit. I have access to each byte, as file_get_contents() gives me a byte by byte binary string (which I think is cool), but I'm having difficulty breaking it into bits for 1-bit, 4-bit, and 8-bit graphics. Any suggestions/resources?
Posted: Wed Jun 27, 2007 4:58 pm
by pickle
I'd suggest using ImageMagick.
Posted: Wed Jun 27, 2007 5:04 pm
by superdezign
It looks like a powerful library, but just like GD, it doesn't support the *.ico format. So, I still have the same dilemma.
Posted: Wed Jun 27, 2007 5:10 pm
by volka
Posted: Wed Jun 27, 2007 5:15 pm
by superdezign
Ahhh. I only checked my PHP Manual files. Thanks for that. ^_^
It was cool being able to read the entire file byte by byte though. Oh well.
Edit: Oh, I didn't know it wasn't an included library.

Posted: Wed Jun 27, 2007 6:16 pm
by superdezign
Does PHP have a function for retrieving ASCII values? Typecasting to int doesn't do it.
Edit: Nevermind. I did some more searching, and I think ord() is what I'm after.