Questions tagged [grayscale]

For questions regarding Grayscale, a Bootstrap theme.

972 questions
5
votes
2 answers

Converting a Grayscale image to black&white using Aforge.Net

I am quite new to Aforge.Net and I am looking for a way to convert a greyscale image to black and white. I couldnt really find any support on it? I managed to convert a normal image to a GrayScale bye applying a Grayscale filter. but i couldnt find…
Mr.Noob
  • 1,005
  • 3
  • 24
  • 58
5
votes
1 answer

UIView in greyscale. View not being redrawn

I managed to get a UIView in greyscale by adding the following view on top: @interface GreyscaleAllView : UIView @property (nonatomic, retain) UIView *underlyingView; @end @implementation GreyscaleAllView @synthesize underlyingView; -…
jalmaas
  • 908
  • 8
  • 17
4
votes
1 answer

Implementing Matlab's rgb2gray in Java

I'm trying to implement Matlab's rgb2gray in Java according to http://www.mathworks.com/help/toolbox/images/ref/rgb2gray.html . I have the following code: public BufferedImage convert(BufferedImage bi){ int heightLimit = bi.getHeight(); int…
skytreader
  • 11,467
  • 7
  • 43
  • 61
4
votes
6 answers

Find most readable colour of text that is drawn on a coloured surface

I'm not sure how to ask this but here goes. I draw a filled coloured rectangle on screen. The colour is in form of R,G,B I then want to draw text on top of the rectangle, however the colour of the text has to be such that it provides the best…
Gautam
  • 2,065
  • 1
  • 24
  • 24
4
votes
2 answers

Convert an SVG to grayscale in python

Scenario I'm trying to convert a colored example.svg file into a grayscaled example_gs.svg in python 3.6 in Anaconda 4.8.3 on a Windows 10 device. Attempts First I tried to apply a regex to convert the 'rgb(xxx,yyy,zzz)' to black, but that created a…
a.t.
  • 2,002
  • 3
  • 26
  • 66
4
votes
1 answer

(iphone) grayscaled image is too dark, can I change the opacity of gray scale image?

I use the following code to turn color image to grayscale image. The resulting image is gray, but too dark. Can I change the opacity of it? (not sure if the term "opacity" is the right word for it) + (UIImage *)convertImageToGrayScale: (UIImage*)…
eugene
  • 39,839
  • 68
  • 255
  • 489
4
votes
1 answer

Classify image as washed-out or not based on the grayscale dynamic range?

I'm trying to recreate an algorithm (from this publication) on Python's OpenCV to detect if an image has a washed-out effect or not. The paper states the following: "Washed out images have a reduced dynamic range (in the gray-scale image) with…
jruivo
  • 447
  • 1
  • 8
  • 22
4
votes
3 answers

How to alpha mask a color

Working in Android (1.5), I have a hundred or so grayscale images in the form of byte arrays. I want to use the images as alpha masks for drawing solid colors in a Canvas. The images are fixed but the colors can change. I can create Bitmap objects…
Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
4
votes
4 answers

converting a PNGImage to grayscale using delphi

hi there here it is my code: procedure TForm4.Button1Click(Sender: TObject); var png: TPNGImage; data: PRGBQarray; p: ^tagRGBQuad; i, o: integer; begin png := TPNGImage.Create; try png.LoadFromFile('C:\Untitled.png'); for o := 1…
Javid
  • 2,755
  • 2
  • 33
  • 60
4
votes
2 answers

Performance issue while converting Rgb image to grayscale C# Code

I am writing a .Net wrapper for Tesseract Ocr and if I use a grayscale image instead of rgb image as an input file to it then results are pretty good. So I was searching the web for C# solution to convert a Rgb image to grayscale image and I found…
4
votes
0 answers

Colored Image of Text to Binary Image

I am developing and OCR. The OCR should accept a picture of a text with font of any color over a plain background of any other color. For this, i need to convert the input image to binary (1-bit image). This is trivially easy in case of white font…
Abdul Wasae
  • 3,614
  • 4
  • 34
  • 56
4
votes
1 answer

Filling holes in a grayscale image in c++

I am doing a c++ program and as part of my program, I need to perform a filling operation on a GRAYSCALE image which is similar to Matlab's imfill function (http://www.mathworks.com/help/images/ref/imfill.html). I tried searching the internet for…
4
votes
2 answers

How to turn grayscale into false color using PIL?

I can't seem to figure out how to take my grayscale function and change it to give me false color. I know I need to break each color (R,G,B) into ranges and then assign colors based on the range for each color. Does anyone have any idea how this can…
4
votes
2 answers

Java ImageIO Grayscale PNG Issue

I have a grayscale image ("lena" actually) which I want to experiment with. I got it as a 512x512 PNG file with 216 shades of gray. What happens is, when I read it with Java ImageIO, like that: String name = args[0]; File fi = new…
InI4
  • 181
  • 12
4
votes
2 answers

Converting a number to a greyscale color in Java

I'm trying to figure out how I can convert a number between 1 and 50 to a greyscale color that could be used here: g.setColor(MyGreyScaleColour); 1 would be lightest (white) and 50 would be darkest (black). e.g. Color intToCol(int colNum) { …
Meir
  • 12,285
  • 19
  • 58
  • 70