I want to learn about images manipulation in PHP and write some code to edit photos.
So, I'm reading about imagefilter() function, but I want to edit the collors manually.
I have a little piece of code with imagefilter to do a image sepia
imagefilter($image, IMG_FILTER_GRAYSCALE);
imagefilter($image, IMG_FILTER_COLORIZE, 55, 25, -10);
imagefilter($image, IMG_FILTER_CONTRAST, -10);
I want to do the same, but without imagefilter(); it is possible?
I have understood that it may be getting the colors in the image and then change them and re-paint it;
To get the image colors I have this:
$rgb = imagecolorat($out, 10, 15);
$colors = imagecolorsforindex($out, $rgb);
And this prints:
array(4) {
["red"]=> int(150)
["green"]=> int(100)
["blue"]=> int(15)
["alpha"]=> int(0)
}
As I can edit those values and integrate them into the picture?
I would appreciate any kind of help: books, tutorials, code pieces.