rgb

RGB values of visible spectrum

I need an algorithm or function to map each wavelength of visible range of spectrum to its equivalent RGB values. Is there any structural relation between the RGB System and wavelength of a light? like this image: sorry if this was irrelevant :-] ...

Script (or some other means) to convert RGB to CMYK in PDF?

Is it possible to write a script for Adobe Illustrator or some other tool that will read the contents of a number of PDF files and convert all the RGB colours to CMYK? If so, could somebody please point out some of the steps involved, or where to find more information on this? ...

RGB value to HSL converter

Google maps api v3 allows "styles" to be applied to the map, including setting the color of various features. However, the color format it uses is HSL (or what seems like it): hue (an RGB hex string) lightness (a floating point value between -100 and 100) saturation (a floating point value between -100 and 100) (from the docs) I ma...

What is the simplest way to extract and write raw RGB data to a file from BitMap?

What is the simple and fastest way to extract raw RGB data from a BITMAP and write the raw data to a file(say .rgb)? ...

How to divide RGB values for correct time of day color?

Hey all, Not the biggest whiz on math here... having a hard time figuring this out. So I get the clients time of day using: var clientdate = new Date(); var clientTime = clientdate.getHours() + 1; Psuedo: If clientTime() = 1, rgb should equal 55,91,128 If clientTime() = 24, rgb should equal 0,30,61 Wh...

How to get the rgb colors from an already allocated color in PHP GD

How would you get the colors from an allocated color something like... $col = imagecolorallocate($im, 255, 50, 5); //A fake function - rgbfromallocate (that I wish I knew) $rgb = rgbfromallocate($col); print $rgb['r'];//255 print $rgb['g'];//50 print $rgb['b'];//5 ...

java Buffered Image : Detecting black pixels

Hi everyone I have this simple code to go through a 24bit color windows bmp file BufferedImage mapa = BMPDecoder.read(new File("maps/map.bmp")); final int xmin = mapa.getMinX(); final int ymin = mapa.getMinY(); final int ymax = ymin + mapa.getHeight(); final int xmax = xmin + mapa.getWidth(); for (int i = xmin;i<xmax;i++) { for ...

How do I display the red channel of an image in Matlab?

I have a 3D matrix im which represents an RGB image. I can do imshow(im) to display the image. I want to display only one of the RGB channels at a time: I want to display the red channel and I want it to appear red. I've tried imshow(im(:,:,1)) but it displays the grayscale image (which is not what I want). How do I display the...

Which is most accurate way to distinguish one of 8 colors?

Imagine we how some basic colors: RED = Color ((196, 2, 51), "RED") ORANGE = Color ((255, 165, 0), "ORANGE") YELLOW = Color ((255, 205, 0), "YELLOW") GREEN = Color ((0, 128, 0), "GREEN") BLUE = Color ((0, 0, 255), "BLUE") VIOLET = Color ((127, 0, 255), "VIOLET") BLACK = Color ((0, 0, 0), "BLACK") WHITE = Color ((255, 255, 255), "WHITE")...

Colorization and Palette Best-Fit Algorithms

Been poking around google and haven't found any like what I'm after. so what is it I'm after? well two things: firstly I'm looking for an algorithm/pseudo-code/white-papers to determine a best-fit color for a give r,g,b tuple from and array of 256 RGB tuples. Secondly, I'm looking for an algorithm/pseudo-code/white-papers to recolor a...

How to Convert Gray scaled image to RGB image?

Hi, I am on MAC OSX. How to convert an gray scaled image to the RGB format. Can i use the CIFilters for converting? Or any other way And also i want to reverse the operation. i.e., convert the RGB format to Gray scaled format. Regards, Dhanaraj. ...

How can I convert between RGB565 and RGB24 image formats in MATLAB?

I am getting an RGB matrix from a microprocessor that outputs an image in RGB565 format. I want to read this into MATLAB, convert it to RGB24 format, and output the image. How do I do this? ...

PHP HSV to RGB formula comprehension

I can convert RGB values to HSV with the following code... $r = $r/255; $g = $g/255; $b = $b/255; $h = 0; $s = 0; $v = 0; $min = min(min($r, $g),$b); $max = max(max($r, $g),$b); $r = $max-$min; $v = $max; if($r == 0){ $h = 0; $s = 0; } else { $s = $r / $max; $hr = ((($max - $r) / 6) + ($r / 2)) / $r; $hg = (...

Color Theory: How to convert Munsell HVC to RGB/HSB/HSL

I'm looking at at document that describes the standard colors used in dentistry to describe the color of a tooth. They quote hue, value, chroma values, indicating they are from the 1905 Munsell description of color: The system of colour notation developed by A. H. Munsell in 1905 identifies colour in terms of three attributes: ...

PHP allocate color without image resource

Can you allocate a color in PHP GD without an image resource? It should be possible because really an allocated color is a number, right? $im = imagecreatetruecolor(100, 100); $col = imagecolorallocate($im, 255, 0, 0); print $col."<br/>"; $col2 = imagecolorallocate($im, 255, 0, 0); print $col2."<br/>"; $im2 = imagecreatetruecolor(600, ...

UISlider to represent the color spectrum

I have a UISlider that is supposed to update the color of a textlabel. Now I want the user to be able to choose between all colors in the spectrum (sort of all anyway). I was thinking of using this UISlider to represent the colors and when dragging the slider the value/color changes. I know the spectrum is not sequential like: [0,0,0].....

[PHP]Converting RGB or HEX To "Long Int" Color

Need to convert RGB or HEX colors to "Long Int" for another program that uses this format. Not sure the specifics of the "Long Int" color format though. It is possible to generate the "Long Int" values manually using this color-picker http://hide-inoki.com/en/soft/chunter/index.html but a php function would be preferred. hexdec genera...

Vba - Set transparent color or direct hex value of label backcolor?

Hi, I want to insert a label into a PowerPoint presentation. But I don't want any background on there, or, have the background color be the same as the what is underneath. I've found that 082F68 is the hex code I want. The RGB code is: 8, 47, 104 This color is supposed to be bluish, but when I insert it, it just gets brown. I really d...

Encode/Decode CMYK Images from Flash Player

I'm currently working on an image editor in Flash Player, and I need to be able to export CMYK images to my server. I'm completely new to color profiles and the like, and I was wondering how I could accomplish this. I am pretty sure all images in Flash Player are ARGB, so is there a way to convert the values properly? ...

PIL convert from cmyk to rgb looses xmp metadata

hi, i need to convert cmyk images to rgb in my python app. unfortunately the metadata gets lost in this process. import Image path = '/path/to/image.jpg' im = Image.open(path) im.convert('RGB').save(path, 'JPEG', quality=95) thank you for any advice ...