Advertisement
fruffl

img bitwise

Sep 18th, 2011
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1.     <?php
  2.         $bits = 2; // 0b010
  3.         $argb = ImageColorAt($im, $x, $y) & 0xfffefefe;
  4.         $ebits = (($bits & 4) << 14) | (($bits & 2) << 7) | ($bits & 1);
  5.         $enbytes = $argb | $encbits;
  6.         ImageSetPixel($im, $x, $y, $encbits);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement