How to code a transparent gradient using imagick in php?
How to code a transparent gradient using imagick in php?
How to code a transparent gradient using imagick in php?
Re: How to code a transparent gradient using imagick in php?
Code: Select all
<?php
$image = new Imagick();
$image->setSize(300,300);
$status = $image->readImage('gradient:cyan-none');
$status = $image->writeImage('gradient.png');
?>
Re: How to code a transparent gradient using imagick in php?
Please have a look at this example:
http://www.eclecticdjs.com/mike/tutoria ... /index.php
test in my computer :
the background should be transparent which is black ,why?
http://www.eclecticdjs.com/mike/tutoria ... /index.php
test in my computer :
the background should be transparent which is black ,why?
Re: How to code a transparent gradient using imagick in php?
Try the PNG32 format rather than PNG.
Re: How to code a transparent gradient using imagick in php?
how ? can you write down the code? how to output a png32?
Re: How to code a transparent gradient using imagick in php?
Use $im->setImageFormat('PNG32');
Re: How to code a transparent gradient using imagick in php?
black as the same result.
Re: How to code a transparent gradient using imagick in php?
Let's try from the command:
- convert -size 100x100 gradient:red-transparent gradient.png
Re: How to code a transparent gradient using imagick in php?
Yes , it works in command line.
Thank you very much.
but i doubt whether it can use in ajax if I use command line.
the code above can echo "yes";if there are many many comand lines to operate an image,can it be ok?
Thank you very much.
but i doubt whether it can use in ajax if I use command line.
Code: Select all
<?php
$width="300";
exec("convert -size {$width}x100 gradient:red-transparent gradient.png");
if(file_exists("gradient.png")){
echo "yes";
}
?>