ini_set('display_errors',1);
header('Content-type: image/png');
$strInputFile = 'front.png'; // transparent image
$im = new Imagick($strInputFile);
$im->setImageBackgroundColor('green');
$im = $im->flattenImages();
echo $im;exit;
Shopify, Shopify Apps, Magento, WordPress, Codeigniter, Joomla, Big Commerce | PHP
Showing posts with label ImageMagick. Show all posts
Showing posts with label ImageMagick. Show all posts
Tuesday, 23 January 2018
How to set background color into transparent image Imagick PHP
Saturday, 26 March 2016
Remove specific color/white/Black from any type of image
//header('Content-type: image/png');
$strInputFile = '20160312105210_girls.jpg';
$target = 'car_transparent.png';
$im = new Imagick($strInputFile);
//$im->paintTransparentImage($im->getImageBackgroundColor(), 0, 10000);
$im->paintTransparentImage('#000', 0, 10000); //Which color you need to remove #000
$im->setImageFormat('png');
//$im->writeImage($target);
$im->destroy();
//echo $im;
Subscribe to:
Posts (Atom)