You can use the trimImage function to trim the image, and then look at the geometry and page info to find how the bounding box of the image that was left after trimming.
$base = new Imagick(realpath('./trim.png'));
$base->trimImage(0);
$geometry = $base->getImageGeometry();
$pageInfo = $base->getImagePage();
printf (
"Width %d Height %d\n",
$geometry['width'],
$geometry['height']
);
printf(
"OffsetX: %d OffsetY %d\n",
$pageInfo['x'],
$pageInfo['y']
);