Questions tagged [contrast]

the difference in color and light between parts of an image

281 questions
368
votes
27 answers

How to decide font color in white or black depending on background color?

I want to show some images like this example The fill color is decided by a field in the data base with the color in hex (ex:ClassX -> Color: #66FFFF). Now, I want to show data above a fill with the selected color (like in the image above) but i…
DJPB
  • 5,429
  • 8
  • 30
  • 44
61
votes
6 answers

Simple illumination correction in images OpenCV C++

I have some color photos and the illumination is not regular in the photos: one side of the image is brighter than the other side. I would like to solve this problem by correcting the illumination. I think local contrast will help me but I don't…
user3762718
  • 623
  • 1
  • 6
  • 9
36
votes
2 answers

How (and why) do you use contrasts?

Under what cases do you create contrasts in your analysis? How is it done and what is it used for? I checked ?contrasts and ?C - both lead to "Chapter 2 of Statistical Models in S", which is not readily available to me.
Tal Galili
  • 24,605
  • 44
  • 129
  • 187
27
votes
1 answer

Auto-contrast Font Color to Background

I have a background of a field. The bottom is green, the top is gray. There is text on top of the background. Is there a way for the text to "sense" what color the background is and to tint the font in a way to make it contrast? For example, the…
Evorlor
  • 7,263
  • 17
  • 70
  • 141
26
votes
7 answers

HTML5 Canvas image contrast

I've been writing an image processing program which applies effects through HTML5 canvas pixel processing. I've achieved Thresholding, Vintaging, and ColorGradient pixel manipulations but unbelievably I cannot change the contrast of the image! I've…
Schahriar SaffarShargh
  • 1,971
  • 2
  • 16
  • 24
25
votes
6 answers

Difference between contrast stretching and histogram equalization

I would like to know the difference between contrast stretching and histogram equalization. I have tried both using OpenCV and observed the results, but I still have not understood the main differences between the two techniques. Insights would be…
Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
23
votes
8 answers

How to programmatically change contrast of a bitmap in android?

I want to programmatically change the contrast of bitmap. Till now I have tried this. private Bitmap adjustedContrast(Bitmap src, double value) { // image size int width = src.getWidth(); int height = src.getHeight(); …
Sanchit Paurush
  • 6,114
  • 17
  • 68
  • 107
18
votes
4 answers

How to pick a background color depending on font color to have proper contrast

I don't know much about color composition, so I came up with this algorithm that will pick a background color based on the font color on a trial an errors basis: public class BackgroundFromForegroundColorConverter : IValueConverter { public…
user610650
14
votes
2 answers

Normalize histogram (brightness and contrast) of a set of images using Python Image Library (PIL)

I have a script which uses Google Maps API to download a sequence of equal-sized square satellite images and generates a PDF. The images need to be rotated beforehand, and I already do so using PIL. I noticed that, due to different light and terrain…
heltonbiker
  • 26,657
  • 28
  • 137
  • 252
14
votes
6 answers

How to use JavaScript to measure how bright a users monitor is?

I've noticed that the brightness of computer monitors drastically varies between computers. As such, this changes the look of web pages greatly. Is there a way to use JavaScript to automatically detect how bright (or dark) a users monitor is so that…
HankV
  • 157
  • 1
  • 4
14
votes
3 answers

What's the fastest way to increase color image contrast with OpenCV in python (cv2)?

I'm using OpenCV to process some images, and one of the first steps I need to perform is increasing the image contrast on a color image. The fastest method I've found so far uses this code (where np is the numpy import) to multiply and add as…
Todd Stellanova
  • 901
  • 1
  • 9
  • 13
13
votes
6 answers

JavaScript color contraster

I'm looking for a technique where we could programmatically pick the best color contrast to apply on text over HTML elements of different (unpredictable) background colors. Since the HTML elements will have different colors, we're looking for a…
Julien Genestoux
  • 31,046
  • 20
  • 66
  • 93
12
votes
4 answers

Brightness and Contrast for a canvas image with javascript

I have an image in a tag var img = new Image(); ctx.drawImage(img,0,0,img.width,img.height); ecc... How is possible to change the Brightness and Contrast of this image with javascript? Tnx
Claudio
  • 1,144
  • 3
  • 11
  • 21
12
votes
3 answers

Adjust the contrast of an image in C# efficiently

Is there an efficient way of adjusting the contrast of an image in C#? I've seen this article which advocates doing a per-pixel operation. Not quick. I'm using colour matrices in places already and find them to be quick. Is there a way to adjust…
Tom Wright
  • 11,278
  • 15
  • 74
  • 148
8
votes
1 answer

Warning message - dummy from dummies package

I am using the dummies package to generate dummy variables for categorical variables, some with more than two categories. testdf<- data.frame( "A" = as.factor(c(1,2,2,3,3,1)), "B" = c('A','B','A','B','C','C'), "C"=…
Max_IT
  • 602
  • 5
  • 15
1
2 3
18 19