Code: Select all
<?php
header('Content-type: image/png');
$oldColor = '#000000';
$baseColor = '#f9d9c4';
$base = new Imagick('assets/background.png');
$image = new Imagick('assets/lop-base2.png');
$color = new Imagick('assets/lop-color2.png');
$base->thumbnailImage(200, 0);
$color->thumbnailImage(200, 0);
$image->thumbnailImage(200, 0);
// Set base color
$color->paintOpaqueImage($oldColor, $baseColor, 255);
$color->paintTransparentImage($baseColor, .80, 100);
// Place layer on image
$base->compositeImage($image, Imagick::COMPOSITE_DEFAULT, 0, 0);
$base->compositeImage($color, Imagick::COMPOSITE_DEFAULT, 0, 0);
// Let's merge all layers (it is not mandatory).
$base->flattenImages();
echo $base;
?>
This is the overlay image ($color):
And this is what it produces:
It's not coloring the very edges because the edges are very soft and they aren't #000000.. I thought that's what the tolerance was for though (3rd parameter in paintOpaqueImage()).. I have it set at it's highest and it still won't color the edges softly... I can't have it all ridged like because of the style of the art and especially when the markings come into play. I just don't want it looking all pixeled. Is there anyway to solve this?
I've tried:
Code: Select all
$color->colorizeImage($baseColor, 100);
$color->paintTransparentImage($baseColor, .80, 100);
Thank you.
I've also tried this:
Code: Select all
$color->colorizeImage($baseColor, 1);
$color->setImageOpacity(.80);
I only wanted the silhouette part to be faded.. But instead the setImageOpacity gets rid of the silhouette completely and just fills the entire square and sets the opacity..