Questions tagged [rgba]

RGBA stands for Red-Green-Blue-Alpha and specifies a color using four values which represent the amount of red, green, blue and alpha (opacity) in the color.

538 questions
6
votes
2 answers

PyPNG to draw a simple filled box

I am trying to draw a simple 256x256 pixel RGBA square using python's png module. I'd like to use the png.Writer function and I imagine I'd have to draw it out using the write() method. I have not had any luck however! I don't have faith in my…
Layla
  • 347
  • 1
  • 6
  • 13
5
votes
1 answer

Android: bitmap to RGBA and back

I'm trying to write a couple of methods to convert an Android Bitmap to an RGBA byte array and then back to a Bitmap. The problem is that I don't seem to hit the formula, because the colors are always coming back wrong. I have tried with several…
Fran Marzoa
  • 4,293
  • 1
  • 37
  • 53
5
votes
1 answer

How to convert an RGBA image to Grayscale in python?

I have array of shape (height, width, 4), i.e., RGBA format, and I want to convert this to grayscale. The original array has RGB values as 0 and the picture is rendered completely based on the alpha values over a white background, hence the…
fortyTwo102
  • 113
  • 1
  • 9
5
votes
1 answer

OpenCV VideoCapture removes alpha channel from video

I have video with alpha channel and I am trying to place it over another video as follows: public static void overlayImage(Mat background, Mat foreground, Mat output, Point location) { background.copyTo(output); for (int y = (int)…
Sanzhar
  • 131
  • 2
  • 14
5
votes
2 answers

Simplest format to store uncompressed RGBA image data

I'm currently creating a software tool that generates images that contain independent RGBA information for each pixel - meaning the red, green, blue and alpha components are supposed to be read and treated as separate entities in a single pixel…
Izhido
  • 392
  • 3
  • 13
5
votes
1 answer

Go image manipulation

I need to load an image and search for colors and replace them. For example on an image I need to search for all red pixels and convert them to purple. I am doing the following (img is a valid .png image): func colorize(img image.Image) { b :=…
Raggaer
  • 3,244
  • 8
  • 36
  • 67
5
votes
2 answers

Mod_rewrite with multiple variables

I'm using a PHP script that dynamically generates transparent PNGs for use as CSS backgrounds from a query string that takes RGBa and HSLa values. The original script can be found here, I've only added HSLa support. Because background URLs with PHP…
Andrei
  • 1,606
  • 4
  • 19
  • 31
5
votes
1 answer

Implement a near real-time CPU capability like glAlphaFunc(GL_GREATER) with RGB source and RGBA overlay

Latency is the biggest concern here. I have found that trying to render 3 1920x1080 video feeds with RGBA overlays to individual windows via OpenGL has limits. I am able to render two windows with overlays or 3 windows without overlays just fine,…
5
votes
1 answer

Precision of alpha value in rgba

I'm plotting many thousand points in a canvas, where each point is an arc with a small alpha value, basically a density plot. At first I used 0.1 for the alpha, but get better results using 0.05. I was surprised that 0.05 worked (Chrome), as I've…
Fiver
  • 9,909
  • 9
  • 43
  • 63
5
votes
5 answers

CSS equivalent for Text Tint

I'm trying to export files from Adobe InDesign to basic HTML + CSS. A user can select some text and change the text colour. Using the InDesign SDK I can fetch the RGB values for that colour and in the CSS file declare color: rgb(R,G,B) which works…
divyanshm
  • 6,600
  • 7
  • 43
  • 72
4
votes
2 answers

Why do browsers render rgba differently on OSX?

I was trying to code up some color manipulation code and was stuck for a long time with alpha, then I (2 hours later) realized browsers render rgba differently. I created this test: http://jsbin.com/adekez/2/ add /edit to look at the code Here are…
4
votes
1 answer

Fastest way to create a transparent image in Mathematica 8 or above?

At the moment I use: transparent // ClearAll transparent[i_] := Module[{r, g, b, a}, {r, g, b} = ImageData /@ ColorSeparate[i, "RGB"]; a = Unitize[3. - (r + g + b)]; (Image /@ {r, g, b, a})~ColorCombine~"RGB" ] Is there a way to play with…
4
votes
1 answer

Create RGBA Colormap in PyGTK

I have a project in Python 2.7 and PyGTK. I need to create a transparent background window, but still be able to display images (pixmap and mask based) and other objects inside of the window. I am using the following code, but no image objects are…
CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
4
votes
3 answers

Get names of a color based on alpha value

Let say I supply R with a color name '#023e8a' Now I want to get 5 following color names with alpha values as c(0.8, 0.6, 0.5, 0.3, 0.2), which will be passed to ggplot as fill aesthetics. Is there any function available in R or ggplot to achieve…
Brian19931
  • 67
  • 4
4
votes
1 answer

How to convert 256 colors palettized RGBA image data to NSImage

I'm a newbie developer and I need your help with something that is probably trivial for you. I have an image data in this pixel format: 256 colors palettized RGBA. It comes from FFmpeg (PIX_FMT_PAL8) and it's explained this way: PIX_FMT_RGB32 is…
Andrea3000
  • 1,018
  • 1
  • 11
  • 26