got it solved, for who is looking for the same. the following code runs from external script hat loads magento bootstrap :
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/../app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$objectManager = $bootstrap->getObjectManager();
$appState = $objectManager->get('\Magento\Framework\App\State');
$appState->setAreaCode('frontend');
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
$appEmulation = $objectManager->get('\Magento\Store\Model\App\Emulation');
$imageFactory = $objectManager->get('\Magento\Catalog\Helper\ImageFactory');
$productRepository = $objectManager->get('\Magento\Catalog\Model\ProductRepository');
$storeId = $storeManager->getStore()->getId();
function getImageURL($pid, $attr=['width'=>500,'height'=>500,'watermarked'=>true,'imageId'=>'product_thumbnail_image'])
{
global $imageFactory,$productRepository;
$product = $productRepository->getById($pid);
$image = $imageFactory->create()->init($product, $attr['imageId'])
->constrainOnly(true)
->keepAspectRatio(true)
->keepTransparency(true)
->keepFrame(true)
->resize($attr['width'], $attr['height']);
return $image->getUrl();
}
$appEmulation->startEnvironmentEmulation($storeId, \Magento\Framework\App\Area::AREA_FRONTEND, true);
$imageUrl = getImageURL($PRODUCT_ID_HERE);
$appEmulation->stopEnvironmentEmulation();
echo($imageUrl);
the use of $appEmulation->startEnvironmentEmulation($storeId, \Magento\Framework\App\Area::AREA_FRONTEND, true);
to prevent getting http://<MAGENTO_ROOT>/pub/static/version1493842505/frontend/_view/en_US/Magento_Catalog/images/product/placeholder/.jpg