2

I'm doing a project with steganography, and I've decided to do it in PHP - I just need some help getting started. The first thing (I think) I need to do, is having a way of displaying each pixel's RGB values, something like this:

https://i.stack.imgur.com/Fj5f0.jpg

How would I go about doing that?

This is what I have so far, probably not useful in any way :)

<?php
$im = imagecreatefrompng("php.png");
$rgb = imagecolorat($im, 10, 15);

$colors = imagecolorsforindex($im, $rgb);

echo "Pixel values: <br>";
var_dump($colors);
?>
Nico
  • 53
  • 1
  • 6
  • You mean this: [Detect main colors in an image with PHP](http://stackoverflow.com/questions/10290259/detect-main-colors-in-an-image-with-php)? – node_modules Mar 02 '17 at 10:25
  • Your question is lacking a lot of contextual information. I'd edit that in myself, but it's a lot and I might change the meaning of your post. Please consider making your title more descriptive to what you're currently trying to do and in your post explain what algorithm you're using and then where you're stuck and what you're trying to do (you only have this last part). Overall, you want to know how to loop through pixels in an image and how to extract and change the least significant bit of an integer with bitwise operations. Questions which have been answered multiple times here. – Reti43 Mar 02 '17 at 11:00

0 Answers0