rgb

Show RGB888 content

Hi all! I have to show RGB888 content using the ShowRGBContent function. The below function is a ShowRGBContent function for yv12->rgb565 & UYVY->RGB565 static void ShowRGBContent(UINT8 * pImageBuf, INT32 width, INT32 height) { LogEntry(L"%d : In %s Function \r\n",++abhineet,__WFUNCTION__); UINT16 * temp; BYTE rValue, gValue, bValue;...

Integer array or struct array - which is better?

In my app, I'm storing Bitmap data in a two-dimensional integer array (int[,]). To access the R, G and B values I use something like this: // read: int i = _data[x, y]; byte B = (byte)(i >> 0); byte G = (byte)(i >> 8); byte R = (byte)(i >> 16); // write: _data[x, y] = BitConverter.ToInt32(new byte[] { B, G, R, 0 }, 0); I'm using inte...

How does one convert 16-bit RGB565 to 24-bit RGB888?

I’ve got my hands on a 16-bit rgb565 image (specifically, an Android framebuffer dump), and I would like to convert it to 24-bit rgb888 for viewing on a normal monitor. The question is, how does one convert a 5- or 6-bit channel to 8 bits? The obvious answer is to shift it. I started out by writing this: puts("P6 320 480 255"); uint16_...

Convert RGB Colour to OLE_Color

I have the unenviable task of maintaining an ActiveX control that expects OLE_Colors as the back/for colour of the control. Is there a tool or a .NET code sample that will convert from an RGB colour (or a hex colour) to an OLE_Color? ...

GPU YUV to RGB. Worth the effort?

Hello, I have to convert several full PAL videos (720x576@25) from YUV 4:2:2 to RGB, in real time, and probably a custom resize for each. I have thought of using the GPU, as I have seen some example that does just this (except that it's 4:4:4 so the bpp is the same in source and destiny)-- http://www.fourcc.org/source/YUV420P-OpenGL-GLS...

CSS3 - Validator - RGBA wrong?

I'm using the W3C CSS Validator with the Profile CSS3 but the validator says that my CSS rgba()'s are wrong. I looked up the Color Module Level 3, and the syntax is the same as mine. I also tried the Dev-Validator, same result. Example input: div.class { border: 1px solid rgba(0, 0, 0, 0.5); } Am I wrong or why does the validat...

Creating Bitmaps from ARGB strings (in actionscript-3)???

Hi, in actionscript 3, what's the fastest way to dump your data (not from a file) into a bitmap for display? I have it working with setPixels and colored rects but that's way too slow/inefficient. Is there a way to load in the raw bytes or hijack the loader class to put in custom loader data? What would be the best/fastest--should I s...

Creating a png with specific rgb values (mac)

I'm using a Mac. When I try creating a png with specific rgb values (i.e. 128,0,0), this is fine (I've tried using both GIMP and photoshop). Now when I open the png file, the color looks slightly different. And when I use the DigitalColor Meter, the rgb values don't match anymore (the 128,0,0 file became 106,7,0). What's going on? Than...

Colour Name to RGB/Hex/HSL/HSV etc

Hello all, I have come across this great function/command. Colour to RGB, you can do this: col2rgb("peachpuff") //returns hex It will return one hex value. I want to extend this using Perl, Python or PHP but I want to be able to pass in, for example, "yellow" and the function returns all types of yellows - their hex/rgb/?/etc value. ...

How do I draw a filled circle onto a graphics object in a hexadecimal colour?

I need to draw a circle onto a bitmap in a specific colour given in Hex. The "Brushes" class only gives specific colours with names. Bitmap bitmap = new Bitmap(20, 20); Graphics g = Graphics.FromImage(bitmap); g.FillEllipse(Brushes.AliceBlue, 0, 0, 19, 19); //The input parameter is not a Hex //g.FillEllipse(new Brush("#ff00ffff"), 0, 0,...

Objective-C RGB to HSB

Let's say I've got the colour FF0000, which is red. Finding a darker colour is easy, I just type maybe CC instead of the FF, but let's say I've got the colour AE83FC, which is a complicated colour, how the heck would I find a lighter or darker version of it automatically? I figured the easy way to do this is to convert my RGB to HSB [Hu...

How to convert a grayscale matrix to an RGB matrix in MATLAB?

rgbImage = grayImage / max(max(grayImage)); or rgbImage = grayImage / 255; Which of the above is right,and reason? ...

Does white color has a fixed value(1 IMO) in an RGB image in MATLAB?

Or say does 1 denotes white for an RGB image? I have this question because of this answer: http://stackoverflow.com/questions/2619668/how-to-convert-a-grayscale-matrix-to-an-rgb-matrix-in-matlab/2619714#2619714 Can someone clarify it? ...

Strange problem when converting RGB to HSV

Hi, I made a small RGB to HSV converter algorithm with C. It seems to work pretty well, but there is one strange problem: If I first convert i.e. a 800x600 picture into HSV map and then back to RGB map without doing any changes in the values, I get some pixels that are convertet incorrectly. Then if I try to convert those misbehaving si...

How to convert CMYK to RGB programmatically in indesign.

Hi, I have a CMYK colorspace in indesign, i want to convert that as RGB color space, I got some codes, but I am getting incorrect data. Some of the codes which I tried are given below double cyan = 35.0; double magenta = 29.0; double yellow = 0.0; double black = 16.0; cyan = Math.min(255, cyan + black); //black is...

XImage - how to resize?

I've got a XImage retrieved by XShmGetImage function. How can I resize it? Is there any function in X11 libraries to perform this operation or I need to use external library? ...

Determine illuminance from RGB image

Is there a way to use camera (web camera or phone camera) as a light meter? Phone camera can grab image and get data in RGB format, but has anyone tried to determine illuminance value (in lux)? I am aware that there is no formula to do this (correct me if I am wrong), but is it possible to model it, and get an approximate value of illum...

Mix RGB colors (L*a*b*)

Hello! Basically I want two mix two colours color1 and color2. Since simple calculation's bring up stuff like blue+yellow = grey ((color1.r + color2.r)/2 etc) i did some research and found that apparently mixing colors in order for the mixed color to look like we expect it too (e.g. blue+yellow = green) isn't that straight forward. Wha...

ActionScript 3.0 Color Output Error?

I'm employing color in a current AS3 project, and have come across what appears to be an error in the Flash Player (version 10). it might also be an error with Apple's DigitalColor Meter (version 3.7.2), which is what i'm using to sample the displayed colors on Mac OS X Snow Leopard (version 10.6.3). //Primary, secondary, and tertiary ...

Color space - RGB and YCbCr question

Hello! I am now trying to understand how JPEG encoding works and everything seems fine except the color transformation part. Before attempting to do a DCT in JPEG algorithm, the image is transformed into YCbCr color space. To me this essentially means that we just (comparing to initial RGB image) take a chunk of color information and d...