English 中文(简体)
Blur alpha频道在PHP/Imagick的形象
原标题:Blur alpha channel in image in PHP/Imagick

考虑以下刀切,我在那里试图树立一个不透明红广场的图像,使之成为一个极具透明度的蓝广场。

$image = new Imagick();
$image->newImage(300, 300,  #0000ff22 );

$draw = new ImagickDraw();
$draw->setFillColor( #ff0000ff );
$draw->rectangle(100, 100, 200, 200);

$image->drawImage($draw);
$image->blurImage(25,23);

$image->setImageFormat("png");
header( "Content-Type: image/png" );
echo $image;

相反,产出看上去红色和蓝色频道正在变得模糊,但不是甲型频道。 I. 手工审判 ALPHA to the blurImage s third para amount, but it has no effect. I m使用6.6.2-6版图像模型(PHP延伸值根据该版本汇编)。

“this”/

问题回答

就像我再次要求:

<?php
$image = new Imagick();
$image->newImage(300, 300,  #0000ff22 );

$draw = new ImagickDraw();
$draw->setFillColor( #ff0000ff );
$draw->rectangle(100, 100, 200, 200);

$image->drawImage($draw);
$image->blurImage(25,23, imagick::COLOR_RED);

$image->setImageFormat("png");
header( "Content-Type: image/png" );
echo $image;
?>

这只是因为我们重新混淆的东西是纯红色的;它不是一般的解决办法。 较为笼统的解决办法将形成一种单独的形象,混淆,然后在背景中加以综合。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签