Questions tagged [argb]

ARGB is a color code used by many languages, and stands for Alpha, Red, Green, Blue.

In computer graphics, pixels encoding the RGBA Color Space information must be stored in computer memory (or in files on disk), in well defined formats. In the most common format the intensity of each channel sample is defined by 8 bits, and are arranged in memory in such manner that a single 32-bit unsigned integer has the Alpha sample in the highest 8 bits, followed by the Red sample, Green sample and the Blue sample in the lowest 8 bits. This is often called "ARGB": Sample layout in a typical 32bpp pixel ARGB values are typically expressed using 8 hexadecimal digits, with each pair of the hexadecimal digits representing the values of the Alpha, Red, Green and Blue channel, respectively. For example 80FFFF00 represents 50.2% opaque (non-premultiplied) yellow. 80 represents a 50.2% alpha value, because it is 50.2% of FF hex (in decimal, 128 is 50.2% of 255), the first FF represents the maximum value red can have; the second FF is like the previous but for green; the final 00 represents the minimum value blue can have (effectively – no blue). Consequently red + green yields yellow. In cases where the alpha is not used this can be shortened to 6 digits RRGGBB, this is why it was chosen to put the alpha in the top bits. Depending on the context a 0x or a number sign (#)[1] is put before the hex digits. A confusing aspect is that on a little-endian CPU (such as Intel or AMD processors) the byte for B is stored at the lowest address, with the bytes representing the colors are in the order B,G,R,A. On a big-endian machine the bytes are in the order A,R,G,B. RGBA byte order

In some contexts, primarily OpenGL, the term "RGBA" actually means the colors are stored in memory such that R is at the lowest address, G after it, B after that, and A last. This is not the format described above. OpenGL describes the above format as "BGRA" on a little-endian machine and "ARGB" on a big-endian machine. When there are more than 8 bits per channel (such as 16 bit or floating-point), it is very common that the channels are stored in R,G,B,A order, even if 8-bit data is stored as ARGB words. This can often lead to confusion when software is converted from 8 bits to higher resolution color. RGBA hexadecimal

In some software originating on big-endian machines such as Silicon Graphics, the term "RGBA" means color is specified similar to ARGB but with the alpha in the bottom 8 bits rather than the top. For example 808000FF would be Red and Green:50.2%, Blue:0% and Alpha:100%, a brown. It should be noted that RGBA is relatively obscure compared to ARGB. Confusing the two can lead to serious color rendering errors. RGBA pixel layout The bytes are stored in memory on a little-endian machine in the order A,B,G,R.

This is an article copied from an external site.( http://en.wikipedia.org/wiki/RGBA_color_space)

166 questions
3
votes
1 answer

Converting uint color to argb hexadecimal for kml color

Good day everyone, I am stuck trying to convert a uint color value into its equivalent argb hexadecimal format. Basically, I am trying to convert a color from Flex(AS3) into its appropriate kml color, which is in the argb hexadecimal format from…
user163757
  • 6,795
  • 9
  • 32
  • 47
3
votes
1 answer

Getting and setting RGB values on a BufferedImage

I'm having a really bad time dealing with RGB values in Java, which made me start trying small experiments with this. I came down to this: loading an image, get it's rgb values and creating a new image with the same values. Unfortunately, this does…
Vespas
  • 385
  • 1
  • 3
  • 11
3
votes
2 answers

how to convert RGB to HEXADECIMAL color in android?

How to convert ARGB(255 0 255 0) color to HEXADECIMAL color. I have ARGB color in database and I retrieve using webservices in JSON format.I want to put color in the text field TAG_DIFF_P (R.id.l7) here it my code, how to add color in background…
ibu
  • 577
  • 4
  • 9
  • 24
3
votes
1 answer

AS3 convert ByteArray of ARGB values to RGB uint

I have a C++ QT application that is sending a ByteArray of ARGB values via a TCP socket. The image is 100 x 100. The problem is that when I read off the ByteArray I can't seem to get the image to display right. I've tried lots of different ways and…
Ben
  • 1,989
  • 22
  • 25
2
votes
4 answers

Create UIColor object from ARGB value

I've in a database a few rows where one field is ARGB value for the related color. I've to read all the rows of these table and convert the ARGB value decimal to a UIColor. I've googled finding this, but I didn't. Is there any way to approach…
NemeSys
  • 555
  • 1
  • 10
  • 28
2
votes
1 answer

How can I draw transparent graphics onto transparent BitmapData?

I'm trying to draw PNGs onto BitmapData that is transparent. I create my BitmapData like this (using ARGB for the color): new BitmapData(width, height, true, 0x00000000); And clean it by using the same ARGB…
Marty
  • 39,033
  • 19
  • 93
  • 162
2
votes
1 answer

Play an ARGB .mov video in a transparent JWindow

I'm trying to code a splash screen for my program cause it takes too long to open. I managed to do it with an image but I have no idea how to do it with an ARGB video. First, I've tried with an image: (on a JWindow extended class) JLabel l = new…
Crih.exe
  • 502
  • 4
  • 16
2
votes
3 answers

Converting ARBG to RGB with alpha blending with a White Background

I have a color hex string stored in the database like 0x78dce6b0; I can convert this to an ARGB color using: string colorString=0x78dce6b0; int hexColor = Convert.ToInt32(colorString ?? "0", 16); Color colorTL = Color.FromArgb(hexColor); Now I want…
ace
  • 2,141
  • 7
  • 29
  • 39
2
votes
4 answers

How to load OpenGL texture from ARGB NSImage without swizzling?

I'm writing an app for Mac OS >= 10.6 that creates OpenGL textures from images loaded from disk. First, I load the image into an NSImage. Then I get the NSBitmapImageRep from the image and load the pixel data into a texture using glTexImage2D. For…
Duncan C
  • 128,072
  • 22
  • 173
  • 272
2
votes
1 answer

Bit operation: inverse argb ignoring alpha

I'm new to bit operations and would like to do the following with it: I need the argb code of an inversed color for my programm, like red becomes cyan or white becomes black. Experimenting with photoshop I found out that therefore you have to…
Duke
  • 386
  • 2
  • 13
2
votes
3 answers

How does Java handle alpha channel?

My understanding is that an RGB value with alpha value example could be this 0xffhexcode. However, what I cannot understand is how 0xff0000ff, a solid blue with max alpha value, is an integer value greater than Integer.MAX_VALUE. How does the…
AnoHito
  • 25
  • 7
2
votes
2 answers

Filling with transparency using Graphics2D

I created an ARGB BufferedImage. Now I'd like to reinitialize it with a transparent background. I tried the following code: (...) if( this.offscreen==null || this.offscreen.getWidth()!= dim.width || this.offscreen.getHeight()!= dim.height…
Pierre
  • 34,472
  • 31
  • 113
  • 192
2
votes
3 answers

NV21 to Bitmap on Android, Very dark image, grayscale, or yellow tint?

I have been looking at converting the NV21 byte[] that I get from onPreviewFrame(). I have searched the forums and google for various solutions. I have tried RenderScripts and some other code examples. Some of them give me an image with a yellow…
Jim Pari
  • 23
  • 3
2
votes
6 answers

IPhone RGBA to ARGB

Im using glReadPixels to grab screen shots of my opengl scene and then turning them into a video using AVAssetWriter on IOS 4. My problem is i need to pass the alpha channel to the video which only accepts kCVPixelFormatType_32ARGB and glReadPixels…
user346443
  • 4,672
  • 15
  • 57
  • 80
2
votes
1 answer

ARGB color is different on iOS in comparison to Android

Take #2066E100 (ARGB8888) as an example, preview the color in Android: (dark green) However, in iOS, the resulted color is like this: (light yellow) It seems to me that the alpha channel doesn't work the same way in iOS and Android. So my question…
Huang C.
  • 398
  • 6
  • 17
1 2
3
11 12