×

php创建透明白色画布

php创建透明白色画布(php图片背景透明)

admin admin 发表于2023-03-27 11:27:09 浏览49 评论0

抢沙发发表评论

本文目录一览:

在php中图像处理新建一个画布用什么函数

$newImage = imagecreatetruecolor($xSize,$ySize);

//增加一个白色的底,不然新建的画布是黑色的

$white = imagecolorallocate($newImage, 255, 255, 255);

imagefill($newImage, 0, 0, $white);

图像处理也经常使用到imagecopymerge、getimagesize、imagecreatefromjpeg等函数,建议你看下这个链接,全是图像处理的函数

ps新建文档时,背景内容如何添加透明(只有白色,黑色和背景色)

1、首先将ps软件打开,

2、点击【ctrl+n】新建画布,

3、在新建画布中我们要将背景内容选中‘透明’,

4、点击确定就可以看到透明的文档了。

扩展资料:

文件操作使用快捷键

新建图形文件:【Ctrl】+【N】  默认设置创建新文件:【Ctrl】+【Alt】+【N】

打开已有的图像:【Ctrl】+【O】  打开为:【Ctrl】+【Alt】+【O】

新建图层:【Ctrl】+【Shift】+【N】  另存为:【Ctrl】+【Shift】+【S】

关闭当前图像:【Ctrl】+【W】  显示的“预置”对话框:【Alt】+【Ctrl】+【K】

存储副本:【Ctrl】+【Alt】+【S】  保存当前图像:【Ctrl】+【S】

应用当前所选效果并使参数可调:【A】  页面设置【Ctrl】+【Shift】+【P】

打开预置对话框:【Ctrl】+【K】  设置透明区域与色域:【Ctrl】+【4】

设置“常规”选项:【Ctrl】+【1】  设置参考线与网格:【Ctrl】+【6】

打印:【Ctrl】+【P】  设置存储文件:【Ctrl】+【2】

设置显示和光标:【Ctrl】+【3】  斜面和浮雕效果:【Ctrl】+【5】

内发光效果:【Ctrl】+【4】  外发光效果:【Ctrl】+【3】

设置单位与标尺:【Ctrl】+【5】  通道选择【ctrl+1.2.3.4】

图像调整使用快捷键

自由变换:【ctrl】+【T】  再次变换:【Ctrl】+【Shift】+【Alt】+【T】

图像大小:【Ctrl】+【Alt】+【I】  色阶:【Ctrl】+【L】

画布大小:【Ctrl】+【Alt】+【C】  色相/饱和度:【Ctrl】+【U】

曲线:【Ctrl】+【M】  黑白:【Alt】+【Shift】+【Ctrl】+【B】

去色:【Shift】+【Ctrl】+【U】  反相:【Ctrl】+【I】

色彩平衡:【Ctrl】+【B】

编辑文字使用快捷键

移动图像的文字:【Ctrl】+选中文字  选择文字时显示/隐藏:【Ctrl】+【H】

选择从插入点到鼠标点的文字:【向上键】+点击鼠标  使用/不使用下划线:【向上键】+【Ctrl】+【U】

使用/不使用中间线:【向上键】+【Ctrl】+【/】  使用/不使用大写英文:【向上键】+【Ctrl】+【K】

使用/不使用Caps:【向上键】+【Ctrl】+【H】

图层操作使用快捷键

正常:【Shift】+【Alt】+【N】  正片叠底:【Shift】+【Alt】+【M】

循环选择混合模式:【Shift】+【-】或【+】  溶解:【Shift】+【Alt】+【I】

颜色减淡:【Shift】+【Alt】+【D】  阈值(位图模式):【Shift】+【Alt】+【L】

背后:【Shift】+【Alt】+【Q】  颜色加深:【Shift】+【Alt】+【B】

强行关闭当前话框:【Ctrl】+【Alt】+【W】  清除:【Shift】+【Alt】+【R】

饱和度:【Shift】+【Alt】+【T】  无限返回上一步:【Ctrl】+【Alt】+【Z】

屏幕:【Shift】+【Alt】+【S】  重新选择:【Ctrl】+【Shift】+【D】

修改字距:【Alt】+【←/→】  叠加:【Shift】+【Alt】+【O】

变亮:【Shift】+【Alt】+【G】  修改行距:【Alt】+【↑/↓】

柔光:【Shift】+【Alt】+【F】  差值:【Shift】+【Alt】+【E】

粘贴:【Ctrl】+【Alt】+【V】  强光:【Shift】+【Alt】+【H】

排除:【Shift】+【Alt】+【X】  全部选取:【Ctrl】+【A】

变暗:【Shift】+【Alt】+【K】  色相:【Shift】+【Alt】+【U】

路径变选区数字键盘的:【Enter】  变亮:【Shift】+【Alt】+【G】

颜色:【Shift】+【Alt】+【C】  羽化选择:【Ctrl】+【Alt】+【D】

光度:【Shift】+【Alt】+【Y】  复制当前图层:【Ctrl】+【J】

载入选区:【Ctrl】+点按图层、路径  取消选择:【Ctrl】+【D】

反向选择:【Ctrl】+【Shift】+【I】  

参考资料来源:百度百科-PS

ps如何把白色画布换成透明画布

1、首先,在计算机上打开Photoshop软件,然后在弹出页面中选择“新建”。

2、接下来,在“新建文档”对话框中选择适当大小的画布,将“背景内容”更改为“透明”,然后单击“创建”。

3、然后,您可以看到创建的画布的背景变得透明。

php怎么输出背景透明的图片?

php可以使用GD库或者ImageMagick工具生成png或者gif的背景透明图片.推荐使用ImageMagick.

这里有范例

准备一张png图片,放到php文件的目录,运行看看效果.

?php

/* Read the image */

$im = new Imagick("test.png");

/* Thumbnail the image */

$im-thumbnailImage(200, null);

/* Create a border for the image */

$im-borderImage(new ImagickPixel("white"), 5, 5);

/* Clone the image and flip it */

$reflection = $im-clone();

$reflection-flipImage();

/* Create gradient. It will be overlayed on the reflection */

$gradient = new Imagick();

/* Gradient needs to be large enough for the image and the borders */

$gradient-newPseudoImage($reflection-getImageWidth() + 10, $reflection-getImageHeight() + 10, "gradient:transparent-black");-php创建透明白色画布

/* Composite the gradient on the reflection */

$reflection-compositeImage($gradient, imagick::COMPOSITE_OVER, 0, 0);

/* Add some opacity. Requires ImageMagick 6.2.9 or later */

$reflection-setImageOpacity( 0.3 );

/* Create an empty canvas */

$canvas = new Imagick();

/* Canvas needs to be large enough to hold the both images */

$width = $im-getImageWidth() + 40;

$height = ($im-getImageHeight() * 2) + 30;

$canvas-newImage($width, $height, new ImagickPixel("black"));

$canvas-setImageFormat("png");

/* Composite the original image and the reflection on the canvas */

$canvas-compositeImage($im, imagick::COMPOSITE_OVER, 20, 10);

$canvas-compositeImage($reflection, imagick::COMPOSITE_OVER, 20, $im-getImageHeight() + 10);

/* Output the image*/

header("Content-Type: image/png");

echo $canvas;

?

ps建透明的画布,但是的的却是白色

你新建的这张图就是透明背景呀!

已经没错了.

而你在使用橡皮的时候, 应该先双击背景层解锁, 然后再使用橡皮.

我发现你新建的时候出错了.

你新建了颜色模式为"灰度"的图像了

"灰度"的图像新建以后, 无论使用什么颜色的画笔在画布上涂抹, 都是灰色的.

你应该将颜色模式改回为"RGB颜色"