similar to: converting rgb() output to 0-255

Displaying 20 results from an estimated 7000 matches similar to: "converting rgb() output to 0-255"

2008 Aug 01
1
creating image using RGB values
Hi R users, I would like to create an image using three matrices which contain the values of Red, Green, and Blue of each pixel, i.e. one matrix which has values of red, one which has values of green, and one which has values of blue. The values are between 0 and 1 instead of 0-255. I have obtained the matrices using the getChannels of pixmap library. I wonder if anyone knows how to create the
2008 Aug 11
6
number of an element in a matrix
Hi, I wonder if there is any function which gives the number of times which an element is repeated in the matrix. Let say there is a matrix, I would like to find out how many times number 2 has been repeated in the matrix, or in other words, how many elements of the matrix are equal 2. Thanks for your help, Rostam [[alternative HTML version deleted]]
2008 Aug 05
2
max size of a matrix
Hi R users, I am trying to create a matrix, but R has problem with the size of dim, wondering if there is anything that I can do? > a <- diag(147456) Error in array(0, c(n, p)) : 'dim' specifies too large an array Thanks for your help Rostam [[alternative HTML version deleted]]
2009 Nov 30
4
Is there a way to convert rgb/hex value to a (nearest) color name?
Hi all, I'm trying to convert a series of rgb codes into a color name. What is my easiest option? So far I'm stuck with just converting to hex using rgb() and I know R knows a number of colours() but a mapping of the two has failed me. Any help in this regard will be highly appreciated. Regards, George
2006 Aug 01
2
rgb and col2rgb color conversion/modification/shading
I want to get a lighter shade of a color...I have a lot of colored objects and want each one printed as a foreground against a slightly lighter background. I thought I could try something like changing the alpha channel by first converting it to rgb. But prior to trying that, I'm stuck with how to get the color after converting using col2rgb() to be interpreted again as a color, rather than
2008 Sep 04
1
showing the image
Hi everyone, I have a matrix containing color values of an image same as following, [1,] "#444444" "#444444" "#434343" "#404040" "#3D3D3D" "#3D3D3D" "#3E3E3E" [2,] "#414141" "#414141" "#414141" "#404040" "#3F3F3F" "#3F3F3F" "#3F3F3F" [3,] "#3E3E3E"
2008 Nov 14
1
running r script in windows command line
Hi, I would like to run a saved script in windows command line. Some command which takes the filename as an argument, and runs it in R. Thanks, Rostam [[alternative HTML version deleted]]
2004 Sep 17
1
Confused about specifying plot colors as RGB values
Based on reading 'rgb' documentation, I would have thought the following would have produced identical results. Can someone explain how to make this happen? I need to be able to specify an array of rgb values for the 'col' parameter. colnames.col <- c("black", "red", "blue", "green") colnames.rgb <- apply(as.matrix(colnames.col), 1,
2012 Jul 10
2
RGB components of plot() colours
A quick question: Is there anywhere a listing of the RGB components of the named colours listed by colors()? For example, where would I find the RGB for "orange1" or "salmon"? When I look at an EPS file from R where I have used these colours, it seems that for: "salmon": 0.9804 0.5020 0.4471 rgb "orange1": 1 0.6471 0 rgb However, this is a tedious way
2023 Jul 23
2
col2rgb() function
Hello I have a palette vector of colour blind colours (in hexadecimal) which I?m using for plots, but they are not see-through, and as I wanted to overlay some histograms I wanted to convert these colours to rgb, when you can set the opacity. I have found the function col2rgb(), which works in the sense that it gives a vector of numbers but these don?t work directly in rgb because they are too
2023 Jul 23
2
col2rgb() function
Thanks That works nicely Nick On Sun, 23 Jul 2023 at 19:26, Ben Bolker <bbolker at gmail.com> wrote: > Does adjustcolor() help? > > cb8<- c("#000000", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2", > "#D55E00", "#CC79A7") > plot(0,0,xlim=c(1,8),ylim=c(0,1)) >
2023 Jul 23
1
col2rgb() function
Does adjustcolor() help? cb8<- c("#000000", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2", "#D55E00", "#CC79A7") plot(0,0,xlim=c(1,8),ylim=c(0,1)) points(1:8,rep(0.5,8),col=cb8,pch=19,cex=2) points(1:8,rep(0.75,8),col=adjustcolor(cb8, alpha.f = 0.3), pch=19,cex=2) On 2023-07-23 2:15 p.m., Nick Wray
2005 Feb 09
2
Converting RGB YUV and back
Hi all, how can I convert a RGB (24 or 32) image I'm getting from a webcam for example to YUV to compress it with theora, decompress it and convert it back to RGB to draw it? Any suggestions? Best regards, Florian (Stuttgart, GERMANY)
2023 Jul 23
1
col2rgb() function
Just one addition which may or may not be useful: The color palette you use is also known as "Okabe-Ito" and it is the default set of colors in the palette.colors() function. This function also has an optional alpha argument. So if you want to generate these colors with an alpha of 0.3 you can also do: palette.colors(8, alpha = 0.3) or more explicitly palette.colors(8, palette =
2023 Jul 23
1
col2rgb() function
Nick, I've also made colors transparent by pasting the hex equivalent of, say, 0.3*256 = 76.9 to the hex color code. e.q. for black it might be "#0000004d" and the 4d is 77 in hex. That way you don't need to convert back and forth so much. If col is "#000000" the transparent version is tcol <- paste0(col,"4d") This would work in one step on a whole
2013 Jun 07
1
col2rgb, factors & documentation
Hello Core Folk. Quite by accident I discovered today that col2rgb, when fed factors, acts on the integer representation of those factors: td <- as.factor(rainbow(5)) # not how I discovered the issue! td res <- col2rgb(td) res # but col2rgb("#FF0000FF") # this is td[1] but does not produce the same answer res[,1] # moreover as.integer(td) col2rgb(5) # the integer value of the
2007 May 03
1
converting YUV to RGB
Hello all, I'd like to convert the theora yuv_buffer to RGB that I can render onto a texture. Googling around, there are a tone of different formulae to do so. There is this (with lots of corrections and amendments further down the page): http://www.fourcc.org/fccyvrgb.php <http://www.fourcc.org/fccyvrgb.php> and there is the MSDN stuff that says you need to convert 4:2:0 and
2000 Mar 29
1
pre summary: mapping of colornames into hsv?
Hi Martin, Great that you follow this. My original intention was to be able to translate colornames to hsv because this would allow using colornames to cut out a certain part of the colorwheel for colorcoding (HSV component H, see my code below) I think internally we might have colors represented as Colornames, ColorIntegers, ColorHexcodes, ColorRGBs, ColorHSVs (ColorCMYs?) however the R-user
2005 Dec 13
4
Ploting graphics using X tints from a color
Hi, I'm trying to draw a 2D plot using multiple tints of red. The (simplified) setup is the following: || year | x | y || My idea is that each year is plotted with a different tint of red. Older year (lightest) -> Later year (darkest). I've managed to plot this with different scales of grays simply by doing: palette(gray(length(years):0/length(years))) before the plot and for each
2004 Oct 07
3
How to use alpha transparency channel for colors?
The release notes for R 2.0.0 states: It is now possible to specify colours with a full alpha transparency channel via the new 'alpha' argument to the rgb() and hsv() functions, or as a string of the form "#RRGGBBAA". NOTE: most devices draw nothing if a colour is not opaque, but PDF and Quartz devices will render semitransparent colours. A new argument