2

How can I display and edit binary images in PHP? For example, how can I edit the image below bit-by-bit in PHP?

Firefox Logo

(Click image to enlarge.)

4
  • You mean, pixel by pixel, correct? The GD library is the most popular way to do this.
    – Pekka
    Commented May 17, 2011 at 17:03
  • yes, pixel by pixel. you can give me some examples?
    – tox
    Commented May 17, 2011 at 17:07
  • You'll be interested in imagesetpixel(): php.net/manual/en/function.imagesetpixel.php it's got a good example
    – Pekka
    Commented May 17, 2011 at 17:14
  • thanks Pekka! please more examples :)
    – tox
    Commented May 17, 2011 at 17:24

1 Answer 1

3

The specific function calls that you'll need to use depend largely on what exactly you'd like to do to the image. However, PHP uses the GD library, which covers an extensive range of image manipulation abilities.

Here are some tutorials to help you get started:

2
  • how can i display binary from image? for example 001001100011000
    – tox
    Commented May 17, 2011 at 17:28
  • If you just want to do that, you can use file_get_contents to read binary files. Commented May 17, 2011 at 19:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.