Hi Fred,
Thanks for the suggestion. I've tried using both of those methods, however, with no luck., e.g.:
Generate a 50% opaque image:
Code: Select all
convert logo: -type PaletteMatte -channel Alpha -evaluate Divide 2 input.png
Or, using IMagick:
Code: Select all
$logo = new Imagick("logo:");
$logo->setImageType(imagick::IMGTYPE_PALETTEMATTE);
$logo->setImageOpacity(0.5);

- Example input (50% opaque image)
- input.png (102.26 KiB) Viewed 17057 times
Next, attempt to apply black background and flatten:
Code: Select all
$logo = new Imagick("input.png");
$logo->setBackgroundColor("black");
$logo->flattenImages();
$logo->setImageFormat("jpg");
$logo->writeImage("actual_result.jpg");
Result (Actual):

- Actual result
- actual_output.jpg (42.67 KiB) Viewed 17057 times
Whereas the expected/desired result should look like:

- Desired result
- desired_output.jpg (23.86 KiB) Viewed 17057 times
Know what I'm missing here? How can I can from that input, to the desired output?
Thanks,
Keith