Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What RGB values should I set for a transparent pixel in a .PNG file?

The transparency of a pixel in a .PNG file is determined by the value of the alpha channel:

  • 0 - Transparent
  • 255 - Opaque

It seems that once the pixel is set to be fully transparent, the RGB components of the pixel should be not important. Is that really true? Is there any convention or are there any guidelines on what RGB values should be set in fully transparent pixels?

In VS2012 when I try to draw with transparent color, nothing happens. It seems that VS applies current color of the tool to the current state of the pixel. Once the current color of the drawing tool is transparent, this means there is no change. What should I do to make a non transparent pixel completely transparent?

like image 490
Kirill Kobelev Avatar asked Oct 30 '13 05:10

Kirill Kobelev


People also ask

What is the RGB for transparent?

RGBA Colors An RGBA color value is specified with: rgba(red, green, blue, alpha). The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).

Can PNG have transparent pixels?

Preserve background transparency in a GIF or PNG image GIF and PNG‑8 formats support one level of transparency—pixels can be fully transparent or fully opaque, but not partially transparent.

What is the value of a transparent pixel?

An alpha value of zero represents full transparency, and a value of (2^bitdepth)-1 represents a fully opaque pixel. Intermediate values indicate partially transparent pixels that can be combined with a background image to yield a composite image. (Thus, alpha is really the degree of opacity of the pixel.

How do I make a PNG file transparent?

Save As A Transparent PNG ImageClick “File” -> “Save As”. Select “PNG (*. PNG) as the file format. Note that though a transparent background looks checkered in Photoshop, it will actually be transparent in the final PNG file.


1 Answers

In the VS 2013 image editor, the following works for me:

  1. Open a png image or other format that supports an alpha channel.

  2. Select View-Toolbars-Image Editor so that you can see the toolbar

  3. Select the eraser from the toolbar. Set the erase width in the propery window to 1

  4. Now clicking ("erasing") a pixel will set it to transparent

like image 81
adg Avatar answered Sep 23 '22 01:09

adg