I have an image that has alpha channel transparency.
我有一个具有alpha通道透明度的图像。
I want to recreate the same background color with RGBA values in CSS but I can not find the real color of the background pixels and their alpha channel value. if I use any sort of color picker it will give me the absolute value of the pixel color which is relevant to its background color.
我想用CSS中的RGBA值重新创建相同的背景颜色,但是我找不到背景像素的真实颜色和它们的alpha通道值。如果我使用任何颜色选择器,它会给我像素颜色的绝对值与它的背景颜色相关。
Do you know any trick to find out the real alpha channel value of a pixel?
你知道找出一个像素真正的阿尔法通道值的诀窍吗?
5 个解决方案
#1
140
In Photoshop's Info panel, you can choose 'Opacity' as a readout mode, though it will show up as a percentage and not as a real alpha value.
在Photoshop的信息面板中,你可以选择“不透明度”作为读出模式,尽管它会以百分比显示,而不是真正的alpha值。
To enable it, simply open the Info window, choose Panel Options and then set the Second Color Readout mode to Opacity.
要启用它,只需打开信息窗口,选择面板选项,然后将第二个颜色读出模式设置为不透明度。
#2
16
Using Gimp, you can use the Color picker.
使用Gimp,您可以使用颜色选择器。
Press shift while clicking on a pixel.
(or tick Use info window
in the tool's options)
点击像素时按shift键。(或勾选工具选项中的“使用信息”窗口)
Once you click on a pixel, the Color Picker Information window
will pop up, showing you details including the alpha level:
点击像素后,会弹出颜色选择器信息窗口,显示细节,包括alpha级:
#3
6
I found out a way to get the exact alpha value in Photoshop. The other solutions only get the closest integer percentage to the actual alpha.
我找到了在Photoshop中获取准确alpha值的方法。其他的解只得到最接近的整数百分比。
- Create a black background layer (#000000).
- 创建一个黑色背景层(#000000)。
- Duplicate the layer whose alpha you need, because we need to edit it. (Or if you need the composite alpha of several layers, duplicate them and merge them)
- 复制你需要的alpha层,因为我们需要编辑它。(或者如果需要多个图层的合成alpha,复制并合并它们)
- Hide the original layer, so that only the black background and the new duplicate is visible.
- 隐藏原始层,使只有黑色背景和新的副本可见。
- Click the new layer and then click "Lock transparent pixels" (The little checkerboard icon above the layers)
- 点击新建图层,然后点击“锁定透明像素”(图层上方的棋盘图标)
- Fill the layer (Shift+Backspace) with White color.
- 用白色填充图层(Shift+Backspace)。
Now you have a picture containing the alpha values of the original image, in greyscale. Just use the Color Picker to select any pixel in the image, and get the exact alpha value (for example #7f7f7f means an alpha of 0x7f, or 127).
现在您有了一个包含原始图像的alpha值的图片,用灰度表示。只需使用颜色选择器来选择图像中的任意像素,并获得精确的alpha值(例如,#7f7f7f表示的是0x7f的alpha值,或127)。
#4
0
use the absolute colour and adjust the transparency in photoshop until it looks right and then use that percentage as your value.
使用绝对的颜色和调整透明度在photoshop中,直到它看起来正确,然后使用百分比作为你的价值。
#5
0
use the PS info panel and set second color readout mode to opacity. turn off the visibility of all layers except the layer of the object you are analyzing (background should be transparent checkerboard) -info now gives original rgb value and correct opacity that can be converted into rgba.
使用PS信息面板,设置第二种颜色的读数模式为不透明度。关闭所有层的可见性,除了你正在分析的对象层(背景应该是透明的棋盘)-info现在提供原始的rgb值和正确的不透明度,可以转换为rgba。
#1
140
In Photoshop's Info panel, you can choose 'Opacity' as a readout mode, though it will show up as a percentage and not as a real alpha value.
在Photoshop的信息面板中,你可以选择“不透明度”作为读出模式,尽管它会以百分比显示,而不是真正的alpha值。
To enable it, simply open the Info window, choose Panel Options and then set the Second Color Readout mode to Opacity.
要启用它,只需打开信息窗口,选择面板选项,然后将第二个颜色读出模式设置为不透明度。
#2
16
Using Gimp, you can use the Color picker.
使用Gimp,您可以使用颜色选择器。
Press shift while clicking on a pixel.
(or tick Use info window
in the tool's options)
点击像素时按shift键。(或勾选工具选项中的“使用信息”窗口)
Once you click on a pixel, the Color Picker Information window
will pop up, showing you details including the alpha level:
点击像素后,会弹出颜色选择器信息窗口,显示细节,包括alpha级:
#3
6
I found out a way to get the exact alpha value in Photoshop. The other solutions only get the closest integer percentage to the actual alpha.
我找到了在Photoshop中获取准确alpha值的方法。其他的解只得到最接近的整数百分比。
- Create a black background layer (#000000).
- 创建一个黑色背景层(#000000)。
- Duplicate the layer whose alpha you need, because we need to edit it. (Or if you need the composite alpha of several layers, duplicate them and merge them)
- 复制你需要的alpha层,因为我们需要编辑它。(或者如果需要多个图层的合成alpha,复制并合并它们)
- Hide the original layer, so that only the black background and the new duplicate is visible.
- 隐藏原始层,使只有黑色背景和新的副本可见。
- Click the new layer and then click "Lock transparent pixels" (The little checkerboard icon above the layers)
- 点击新建图层,然后点击“锁定透明像素”(图层上方的棋盘图标)
- Fill the layer (Shift+Backspace) with White color.
- 用白色填充图层(Shift+Backspace)。
Now you have a picture containing the alpha values of the original image, in greyscale. Just use the Color Picker to select any pixel in the image, and get the exact alpha value (for example #7f7f7f means an alpha of 0x7f, or 127).
现在您有了一个包含原始图像的alpha值的图片,用灰度表示。只需使用颜色选择器来选择图像中的任意像素,并获得精确的alpha值(例如,#7f7f7f表示的是0x7f的alpha值,或127)。
#4
0
use the absolute colour and adjust the transparency in photoshop until it looks right and then use that percentage as your value.
使用绝对的颜色和调整透明度在photoshop中,直到它看起来正确,然后使用百分比作为你的价值。
#5
0
use the PS info panel and set second color readout mode to opacity. turn off the visibility of all layers except the layer of the object you are analyzing (background should be transparent checkerboard) -info now gives original rgb value and correct opacity that can be converted into rgba.
使用PS信息面板,设置第二种颜色的读数模式为不透明度。关闭所有层的可见性,除了你正在分析的对象层(背景应该是透明的棋盘)-info现在提供原始的rgb值和正确的不透明度,可以转换为rgba。