rgb

Image handler in java write rgb values without using native java classes

I need to read an image pixel by pixel to obtain an array of RGB and write the image in shades of red, blue and green, but without using Image.io or specific java classes that handle and images ...

Convert from HEX color to RGB struct in C

Convert from color HEX code to RGB in pure c using C library only (without C++,templates, etc.) RGB struct may be like this -> typedef struct RGB{ double r; double g; double b; } RGB1; function should return RGB1 ...

How to correct RGB color taken with camera ?

Hi everyone, I had this question in my mind lately: I have taken a photo of a picture in my computer's display using my phone's camera (2MP) then transferred the picture to my computer. What i have noticed is that the individual pixel (RGB) values of the photographed image are different from the original picture (which is obvious !) but...

Is it acceptable to use RGB colors when designing HTML emails

It is best practice to stick with HEX colors when designing HTML emails - does it matter? ...

how to convert 16-bit RGB Frame Buffer to a viewable format?

I'm working with someone else's code on a device which can put an image to /dev/fb/0 and show up on video out or send it over the network to a client application. I don't have access to the old source for the client app, but I know the following about the data: 720x480 16-bit RGB (I'm no sure if it's 5,5,5 or 5,6,5) RAW (no headers w...

How can I convert (encode) RGB buffer to JPEG in plain C?

I would expect that there's some sort of library that I can use in this fashion: int* buffer[720*480]; // read in from file/memory/network stream raw_params params; params.depth = 16; params.width = 720; params.height = 480; params.map = "rgb"; params.interleave = JPEG_RAW_INTERLEAVE_OFF; jpeg_encode(buffer, params) But I can't seem ...

C++, Negative RGB values of pixels using OpenCV

I'm using OpenCV to iterate through an image and find the colour of each pixel, here's some of the code I'm using: IplImage* img = cvLoadImage("c:\\test.png"); int pixels = img->height * img->width; int channels = img->nChannels; for (int i = 0; i < pixels*channels; i+= channels) { unsigned char red = img->imageData[i + 2]; u...

Java Array RGB Manipulation

Ok so lets say I have an int[][] arrayA and an int[][] arrayB. At any given coordinate in this array lies an RGB value. What I want to do is merge the RGB values from arrayA and array2 into a new array, newArray, using a weighted average method. So what I'm doing is extracting the red, green, and blue values from each RGB value like th...

How to extract Y,U, and V components from a given yuv file using Matlab? Each component is used for further pixels level manipulation.

Hey guys. I'm currently playing with YUV file. Do you have any suggestion on how to extract y,u,v components from a yuv video? I found a piece of program which was shown below. But I don't know which part is the valid components that I want. Thanks. % function mov = loadFileYuv(fileName, width, height, idxFrame) function [mov,imgRgb] =...

Subtracting RGB values

I'm doing some work with images; I don't want to convert them to grayscale because I want to factor in the color. As you know, with grayscale, different colors can have the same grayscale value. If I were to subtract RGB values of one pixel from another, I assume that they will still have skew? That is to say, I would need to weight t...

Generate RGB colors as different as possible.

I have been using the random function to generate color values xi = [a, b, c] where a, b, and c can be any number from 0 to 255. I need ideas to write a function that generate x values as different as possible for the human eye. One of the problems I am having is that I don't know the number of x elements that will be generated. So my p...

Plotting RGB spectrum as 2-d color matrix?

Any suggestions on how I might go about plotting the RGB color space as a 2-D matrix? I need a theoretical description of what's going on; a code sample or pseudocode would be helpful but is not required. Thanks! ...

Compare RGB colors in c#

Hello, I'm trying to find a way to compare two colors to find out how much they are alike. I can't seem to find any resources about the subject so I'm hoping to get some pointers here. Idealy, I would like to get a score that tells how much they are alike. For example, 0 to 100, where 100 would be equal and 0 would be totally different...

Java: detecting if a display is RGB or BGR

I know that most screens are RGB, but is there a way in Java to detect if a display is physically using RGB or BGR order? (note that I'm definitely not talking about the way images are stored in software nor in the video card's memory but about the physical property of the display(s) the Java app is running on) ...

YCbCr to RGB from matrix table.

Hi Below is a matrix to convert YCbCr to RGB, Can you tell me how can I get formula to convert YCbCr to RGB? I mean, I have YCbCr value available and I want to get RGB from it. ...

Function to convert YCbCr to RGB?

I have Y,Cb,Cr values each of 8 bit, can you give me simple C function which converts it to R,G,B each of 8 bit. Here is a prototype of it. void convertYCbCrToRGB(unsigned char Y, unsigned char cg, unsigned char cb, unsigned char &r, unsigned &g, unsigned &b); P.S I am looking for correct conversion forumla only. Because I am finding ...

How to apply , converting image from colored to grayscale algorithm to android ?

I am trying to use one of these algorithms to convert a RGB image to grayscale : The lightness method averages the most prominent and least prominent colors: (max(R, G, B) + min(R, G, B)) / 2. The average method simply averages the values: (R + G + B) / 3. The formula for luminosity is 0.21 R + 0.71 G + 0.07 B. But i g...

Help with the theory behind a pixelate algorithm?

So say I have an image that I want to "pixelate". I want this sharp image represented by a grid of, say, 100 x 100 squares. So if the original photo is 500 px X 500 px, each square is 5 px X 5 px. So each square would have a color corresponding to the 5 px X 5 px group of pixels it swaps in for... How do I figure out what this one color...

How can I convert an RGB image to grayscale but keep one color?

So I am trying to create an effect similar to Sin City or other movies where they remove all colors except one from an image. I have an RGB image which I want to convert to grayscale but I want to keep one color. This is my picture: I want to keep the red color. The rest should be grayscale. This is what my code outputs so far (yo...