It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am looking to isolate "brown" colors by rgb values. Not just 1 brown color, but the wide spectrum of colors that are perceived as brown - tan, suede, dirt, etc.
Any ideas on how to do this? I'm thinking that maybe if Red is less than 128, and Green is between 70 and 138, and blue is less than 128, than it appears brown. Something along those lines.
A really simple heuristic would be something like, in pythony pseudocode
def isBrown(red, green, blue):
# Kind of maximum lightness
if blue > parameter_1
return False
# how green or red tinted can it be
if absolute_value(red - green) > parameter_2:
return False
# Light brown is just yellow or orange
if maximum_of(red, green) > parameter_3:
return False
else:
return True
The tune parameters 1 through 3 until it works nicely. Perhaps replace if absolute_value(red - green) > parameter_2: with if absolute_value(red - green*parameter_2b) > parameter_2a: so that more greeny or reddy ones are selected depending on parameter_2b. Perhaps change maximum_of to something else. etc. etc.
It really depends what you consider to be brown. It is a colour category for which there is rather high inter-subject variability and strong contextual effects (colours next to it changes how it looks).
Think you need to use something like this: http://www.colorpicker.com/ and look at the shape of the colours you decide on and then work out how to express that algorithmically.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Is there a way to calculate the largest possible file size for a JPEG image with a fixed resolution?
For example, is it possible to say that a 1024x768 image has a maximum file size of 3MB?
No there is not. It uses quantization matrices to try and reduce frequencies to 0, depending on how good that works, and how much of a pattern occurs for all these values, the compression becomes more efficient.
See JPEG Wikipedia Article, section Codec Example for more details on how the compression works. It should become clear from that that it is not possible.
Not really. JPG compression depends on quality settings, and the content of the image. A single solid color "tile" will compress far better than a "busy" image.
E.g. a solid white 800x600 image saved in The Gimp at 85% quality is a 3,155 bytes .jpg file. Filling that same 800x600 image with the RGB noise filter produces a 134,935 byte .jpg.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
The question may be vague but I will try to word it as best as possible.
So I came up with a crude algorithm to compute whether a sentence (part of a review snippet) is positive or negative or neutral (let's call this EQ for the sentence). So for 5 sentences I have some ratings for sentence based on [-100, 100]. The review has to be rated on [0, 5] basis
(0, 39.88)
(1, 73.07)
(2, 69.65)
(3, 51.43)
(4, 76.74)
The choice that I am struggling with is what method should I choose to now compute the overall rating for the review snippet.
I researched a little and tried two options
1) 50% Percentile: for above data point I got it as 70. So mapping it on 0-5 scale turns out 4.2. Results are good but the sad part is that percentile doesn't capture how the EQ varied in the snippet from one sentence to another (since it works on sorted data so the variation is lost).
2) Lagrange Polynomial: Here it came close to 69. But the prob with this approach is that I often calculate it for mid of the X-range (in this case 2) so as such this too doesn't capture the variation in EQ of the sentence (here end points do not matter, it would mostly give mid range value).
Any ideas, what method should I choose which can capture the EQ variation in the snippet and give an appropriate value which can be used to get overall sentiment.?
Probably something like excel draws trendline, prob that can be used ??
If you are interested in untrained/unsupervised sentiment analysis, read this classic paper by Peter Turney which uses an unsupervised approach achieving an accuracy of around 75% - http://nparc.cisti-icist.nrc-cnrc.gc.ca/npsi/ctrl?action=rtdoc&an=8914166
Sentiment Analysis is fun!
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Is there any efficient way to fetch texture data in a random way? That is, I'd like to use a texture as a look-up table and I need random access to its elements. Therefore I'd be sampling it in a random fashion. Is it a completely lost cause?
Random access is a basic feature of GLSL. E.g.
vec2 someLocation = ... whatever you like ...;
vec4 sampledColour = texture2D(sampler, someLocation);
Depending on your hardware, it may cost more to read a texture if you've calculated the sample locations directly in the pixel shader rather than out in the vertex shader and allowed them to be interpolated automatically as a varying, but that's just an immutable hardware cost relating to the decreased predictability of what you're doing.
You could always pass another texture to the shader containing random values and sample from that. That will give you the same random value for each texture coordinate but if you dont want that you can always multiply the coordinate by a uniform seed that you updated each frame.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Seeing as how the three primary colors are cyan, magenta and yellow (CMY), why do monitors and almost all the GUI components out there use red, green and blue (RGB)? (If I'm not mistaken, printers use the CMYK model.)
Is there a historical, hardware/software, or other reason for it?
There's a difference between additive colors (http://en.wikipedia.org/wiki/Additive_color) and subtractive colors (http://en.wikipedia.org/wiki/Subtractive_color).
With additive colors, the more you add, the brighter the colors become. This is because they are emitting light. This is why the day light is (more or less) white, since the Sun is emitting in almost all the visible wavelength spectrum.
On the other hand, with subtractive colors the more colors you mix, the darker the resulting color. This is because they are reflecting light. This is also why the black colors get hotter quickly, because it absorbs (almost) all light energy and reflects (almost) none.
Specifically to your question, it depends what medium you are working on. Traditionally, additive colors (RGB) are used because the canon for computer graphics was the computer monitor, and since it's emitting light, it makes sense to use the same structure for the graphic card (the colors are shown without conversions). However, if you are used to graphic arts and press, subtractive color model is used (CMYK). In programs such as Photoshop, you can choose to work in CMYK space although it doesn't matter what color model you use: the primary colors of one group are the secondary colors of the second one and viceversa.
P.D.: my father worked at graphic arts, this is why i know this... :-P
The difference lies in whether mixing colours results in LIGHTER or DARKER colours. When mixing light, the result is a lighter colour, so mixing red light and blue light becomes a lighter pink. When mixing paint (or ink), red and blue become a darker purple. Mixing paint results in DARKER colours, whereas mixing light results in LIGHTER colours.
Therefore for paint the primary colours are Red Yellow Blue (or Cyan Magenta Yellow) as you stated. Yet for light the primary colours are Red Green Blue. It is (virtually) impossible to mix Red Green Blue paint into Yellow paint, or mixing Red Yellow Blue light into Green light.
The basic colours are RGB not RYB. Yes most of the softwares use the traditional RGB which can be used to mix together to form any other color i.e. RGB are the fundamental colours (as defined in Physics & Chemistry texts).
The printer user CMYK (cyan, magenta, yellow, and black) coloring as said by #jcomeau_ictx.
You can view the following article to know about RGB vs CMYK: RGB Vs CMYK
A bit more information from the extract about them:
Red, Green, and Blue are "additive
colors". If we combine red, green and
blue light you will get white light.
This is the principal behind the T.V.
set in your living room and the
monitor you are staring at now.
Additive color, or RGB mode, is
optimized for display on computer
monitors and peripherals, most notably
scanning devices.
Cyan, Magenta and Yellow are
"subtractive colors". If we print
cyan, magenta and yellow inks on white
paper, they absorb the light shining
on the page. Since our eyes receive no
reflected light from the paper, we
perceive black... in a perfect world!
The printing world operates in
subtractive color, or CMYK mode.
the 3 additive colors are in fact red, green, and blue. printers use cmyk (cyan, magenta, yellow, and black).
and as http://en.wikipedia.org/wiki/Additive_color explains: if you use RYB as your primary colors, how do you make green? since yellow is made from equal amounts of red and green.
This is nothing to do with hardware nor software. Simply that RGB are the 3 primary colours which can be combined in various ways to produce every other colour. It is more about the human convention/perception of colours which carried over.
You may find this article interesting.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
I'm looking for RGBA code for red color with opacity: Can someone tell me how can i find about it?(or where i can learn more about RGBA colors? Thanks.
rgba(red, green, blue, alpha)
The range for red, green and blue is 0-255.
The high the number, the more presence the color shows.
The range for alpha is 0.0-1.0.
The higher the number, the higher the opacity.
Fully opaque red would be rgba(255, 0, 0, 1)