亮度遮罩和alpha遮罩

In previous articles we’ve looked at creating 32-bit PNGs for use in web pages. In this exercise we are going to make a more complex image, working solely in the mask layer. I’ll be using Adobe PhotoShop CS5, but the techniques illustrated should be applicable to any version of PhotoShop, and translatable to other image editing programs such as GIMP. We’ll use the result of this tutorial in several articles to come, including PNG Optimisation and CSS3 animation.

在之前的文章中,我们研究了如何创建32位PNG以便在网页中使用。 在本练习中,我们将制作一个更复杂的图像,仅在遮罩层中工作。 我将使用Adobe PhotoShop CS5,但是所示的技术应适用于任何版本的PhotoShop,并且可以翻译为其他图像编辑程序,例如GIMP 。 在接下来的几篇文章中,我们将使用本教程的结果,包括PNG Optimization和CSS3 animation 。

步骤1:设定 (Step 1: Setup)

Our initial goal is to make a banner for some text that is easily adjustable, with the foreknowledge that we will be animating it later with CSS. First, you’ll want your canvas in PhotoShop to be a little wider and taller than your final banner to allow for animation: I would suggest around 1000px × 250px. Make sure that you name the document and make its background transparent

before you press OK.

按“确定” 之前 ,请确保为文件命名并使其背景透明。

Make sure you have default colours (black foreground, white background) selected in the color picker by pressing D on your keyboard. Ctrl+ click to rename the current layer. After pressing OK, fill the layer with white by pressing SHIFT + F5 and choosing Background Color as the fill option. Immediately create a mask for your layer by clicking on the Add Mask icon in the layers palette. The mask is selected by default. We will be doing all of our work directly on the layer mask:

you’ll be able to tell that you are on the layer mask by the small highlighted frame around the layer mask icon in the Layer palette.

通过按键盘上的D ,确保在颜色选择器中选择了默认颜色(黑色前景色,白色背景)。 Ctrl +单击以重命名当前图层。 按OK后 ,通过按SHIFT + F5并选择“ 背景色”作为填充选项,用白色填充图层。 单击图层调板中的“ 添加蒙版”图标,立即为您的图层创建一个蒙版。 遮罩默认为选中状态。 我们将直接在图层蒙版上进行所有工作: 您可以通过“图层”调板中的图层蒙版图标周围的高亮显示小框来判断自己在图层蒙版上。

步骤2:建立云端 (Step 2: Create the clouds)

From the menu bar, choose Filter / Render / Clouds.

从菜单栏中,选择“ 过滤器/渲染/云” 。

The result doesn’t look terribly cloud-like yet, but we’ll improve that. Choose Filter / Render / Difference Clouds. Re-apply the Difference Clouds filter twice more by pressing CMD-F twice in succession. (You will be able to see the mask we are creating more clearly by going to the Channels palette and temporarily turning on the visibility of the Clouds Mask while turning off the others by clicking on their eye icons.)

结果看起来还不是很像云,但是我们会改善它。 选择“ 过滤器/渲染/差异云” 。 连续两次按CMD-F,再次应用“ 差异云”过滤器两次。 (通过转到“ 通道”调板并暂时打开“ Clouds Mask”的可见性,同时单击其他人的眼睛图标将其关闭,您将能够更清楚地看到我们正在创建的Mask 。)

We want to tighten up the edges of the clouds a little. Press

CMD-L to bring up the Layers window and adjust the sliders to the approximate locations you see in the screenshot to the right.

CMD-L调出“ 层”窗口,并将滑块调整到您在右侧屏幕快照中看到的大致位置。

Finally, apply a little Gaussian blur to the cloud mask (Filter / Blur / Gaussian Blur) to break it up a fraction more, using a value of 1.6.

最后,对云蒙版应用一点高斯模糊( 滤镜/模糊/高斯模糊 ),使用1.6值将其分解得更多。

步骤3:汇出PNG-24 (Step 3: Export the PNG-24)

While we could continue to make improvements, let’s leave our clouds in their current state. Again, all of the work has been on the mask: the impression of “clouds” is rendered solely by the transparency information in the alpha mask.

虽然我们可以继续进行改进,但让我们将云保持在当前状态。 同样,所有工作都在遮罩上进行:“云”的印象仅由Alpha遮罩中的透明度信息提供。

Go ahead and save the image as a PNG-24 from PhotoShop via File / Save for Web and Devices. If you are still unclear as to why we are using PNGs and not GIFs as our export, feel free to preview the difference between the two formats in the export screen that appears. Call the final file clouds.png. It might also be wise to save your original image as clouds.psd, as we will be using it in the next lesson.

继续,并通过File / Save for Web and Devices从PhotoShop将图像另存为PNG-24。 如果您仍然不清楚我们为什么要使用PNG而不是GIF作为导出文件,请在出现的导出屏幕中预览两种格式之间的区别。 将最终文件clouds.png 。 将您的原始图像另存为clouds.psd可能也是明智的选择,因为我们将在下一课中使用它。

注意 (Note)

While you’re exporting the PNG file, take a look at the file size: that is an issue we are going to solve in the next article.

在导出PNG文件时,请查看文件大小:这是我们将在下一篇文章中解决的问题。

步骤4:建立标记和基本CSS (Step 4: Create the markup and basic CSS)

In the text editor of your choice, create an HTML. Inside the <body>, place something like the following:

在您选择的文本编辑器中,创建一个HTML。 在<body> ,放置以下内容:

<div id=clouds><q>And suckas be thinking' that they can fake this<br>
But I'm gonna drop it at a higher level…</q>
</div>

注意 (Note)

It is usually incorrect to put single pieces of content in a <div>, but we are doing so in this case to make our background easier to apply, and styled separately from our quotation. Similarly, we are using the verboten <br /> tag to break up lyrical lines, a task for which it is entirely suited. Finally, we are sizing the font used in pixels as the background is a bitmap.

将单个内容放入<div>通常是不正确的,但是在这种情况下,我们这样做是为了使我们的背景更易于应用,并且与引用分开设置样式。 同样,我们使用verboten <br />标记来断开歌词,这是完全适合的任务。 最后,由于背景是位图,因此我们要调整像素中使用的字体的大小。

Next, apply some CSS. We want the <div> to contain both a CSS gradient background and the PNG image. This is possible with CSS’s support for multiple backgrounds, but we must be careful to specify them in the correct order:

接下来,应用一些CSS。 我们希望<div>同时包含了CSS渐变背景和PNG图像。 CSS支持多种背景是可能的 ,但是我们必须小心以正确的顺序指定它们:

div#clouds {
background-image: url(clouds.png),
linear-gradient(#3e6caa, #76b6f4);
background-size: cover;
font-family: Highway, Arial, sans-serif;
background-size: cover;
}
div#clouds q {opacity: 0.7;
}

As you can see, the clouds appear over our gradient “sky”, and are semi-transparent against it, due to the alpha mask we created in the PNG. One advantage is that we can modify and move the clouds and sky backgrounds separately, or animate it using more CSS, no background video or JavaScript required.

如您所见,由于我们在PNG中创建的Alpha蒙版,云层出现在渐变“天空”上,并且相对于它是半透明的。 优势之一是,我们可以分别修改和移动云层和天空背景,也可以使用更多CSS对其进行动画处理,而无需背景视频或JavaScript 。

翻译自: https://thenewcode.com/268/Creating-Alpha-Masked-Clouds-as-PNGs-in-PhotoShop

亮度遮罩和alpha遮罩

亮度遮罩和alpha遮罩_在PhotoShop中将Alpha遮罩的云创建为PNG相关推荐

  1. 一个遮罩层怎么遮罩两个图层_遮罩效果全解(13种方法)

    初学者关于遮罩的话题问的较多,下面我将遮罩的一些常见问题进行一下归纳. 1.请问遮罩的原理是什么? 遮罩层好比黑夜中的一支手电筒,照在哪儿(指被遮罩层)哪儿就显现. 第一步:创建两个图层,命名,一个是 ...

  2. html怎么添加遮罩层,如何在浏览器窗口上添加一个遮罩层

    背景 在web2.0中,页面弹窗是一个很常见的交互方式,这样既可以避免不必要的页面跳转,也可以改进界面的布局和可交互性. 但是,浏览器原生的弹窗函数(alert, confirm, prompt)有着 ...

  3. view.setAlpha(float alpha)与view.getBackground().setAlpha(int alpha)的区别

    Android中对一个View控件透明度的设置,提供了两个方法:view.setAlpha(float alpha)与view.getBackground().setAlpha(int alpha)这 ...

  4. alpha融合---PS制作带连续alpha值的png图片

    最近做个项目,大致类似激萌(FaceU)那样给人头上加有趣的卡通头饰,这时候我们需要做一个头饰模板供后续程序调用.当然这个模板可以由专业设计人员设计好,但是我们没有这个条件,那么可以用激萌生成好的图片 ...

  5. java 写文件 权限不够_教你解决Linux系统中JAVA创建文件后权限不足的问题

    在作业中,项目使用文件上传. 这个功能很常见. 当Kai Ge今天更改其官方帐户时,他遇到了一个问题,即无法访问下载的文件,也无法通过浏览器访问该文件. 它是怎么发生的? 经过许多问题之后,事实证明这 ...

  6. Design the Web: Creating a Repeating Background in Photoshop Photoshop网页设计教程之如何创建重复的背景 Lynda课程中文字幕

    Design the Web: Creating a Repeating Background in Photoshop 中文字幕 Photoshop网页设计教程之如何创建重复的背景 中文字幕Desi ...

  7. unity 图片遮罩有锯齿_如何消除UGUI Mask遮罩的锯齿

    一般的遮罩做法是在Image的节点前,增加一父节点Mask,然后通过Mask包含Image,就是用父Mask的遮罩Image 可程序的事件总不会那么顺畅的,反正就是不行 结果是锯齿严重: 具体原理不知 ...

  8. 一个遮罩层怎么遮罩两个图层_premiere遮罩功能在哪儿_怎么在视频中加遮罩图层_遮罩图层制作教程详解...

    premiere是一款非常受大众喜爱的视频剪辑神器.有时候为了给在pr软件中剪辑的视频做一些遮罩的动画,你可能会到ps中画出形状然后填充黑色或者白色,然后在导入pr软件中做动画使用.这样不免有些繁琐了 ...

  9. java遮罩层_[Java教程]Jquery实现遮罩层

    [Java教程]Jquery实现遮罩层 0 2012-12-13 17:00:10 1.假设#main为页面body中的最外层Div标签 2.背景被遮罩后,显示的弹出窗(默认是不显示的,所包含的CSS ...

最新文章

  1. 数据治理展示血缘关系的工具_Nebula Graph 在微众银行数据治理业务的实践
  2. go包package的使用细节
  3. boost::hana::partition用法的测试程序
  4. react 合并数组_React 常被忽视的细节。
  5. 我国物联网环境尚未成熟 传感器面临机遇
  6. servlet实现用户登录
  7. 架构师论坛 创业_我在早期创业时作为设计师学到的东西
  8. SqlDataReader对象的NextResult方法读取存储过程多个结果集
  9. Natasha 4.0 探索之路系列(三) 基本的动态编译
  10. PHP中文乱码解决办法
  11. swf文件在线预览 html,在线浏览swf文件
  12. java 程序找错_JAVA程序找错~
  13. arcgis导入坐标点转面_arcgis矢量化建筑数据
  14. 蓝叠BlueStacks mac(安卓模拟器)中文免费版
  15. MySQL按照拼音排序
  16. 项目开发过程中业务流程图的绘制
  17. html左边是菜单右边是内容,左首菜单栏右侧内容
  18. 爪爪博士:小奶猫感冒发烧怎么降温才有效
  19. 无刷直流电机(BLDC)建模与仿真
  20. SQLMAP的常用参数

热门文章

  1. 安装安全防护软件有助于保护计算机不受侵害,9. 安装安全防护软件有助于保护计算机不受病毒侵害。...
  2. [AHK]为Word增加求和热键,审计求和助手
  3. win10WSL--Linux LTS安装报错(Error Code: 0x8007019e,0x8000000D)
  4. 小鹏汽车为什么取名为小鹏?何小鹏亲自会答:最初叫“橙子” 原因非常凑巧
  5. 智能判定魔兽是否在聊天状态
  6. 给跪了,看看这些一战成名的90后高端技术宅!
  7. 2010世界杯直播(北京)时间!!!
  8. 【Ubuntu】22.04安装搜狗输入法
  9. 转:Unix传奇(下篇)
  10. idea 导出jar包 及 解决缺少jar包依赖问题