grayscale

Android : Converting color image to grayscale [duplicate]

≡放荡痞女 提交于 2019-11-26 12:07:19
问题 This question already has answers here : Convert a Bitmap to GrayScale in Android (5 answers) Closed 5 years ago . Hi guys I need your help, I\'m trying to convert color image into grayscale using the average of red, green, blue. But it comes out with errors, Here is my code imgWidth = myBitmap.getWidth(); imgHeight = myBitmap.getHeight(); for(int i =0;i<imgWidth;i++) { for(int j=0;j<imgHeight;j++) { int s = myBitmap.getPixel(i, j)/3; myBitmap.setPixel(i, j, s); } } ImageView img = (ImageView

Greyscale Background Css Images

橙三吉。 提交于 2019-11-26 07:28:23
问题 I\'ve searched a lot on the web but I cannot find a cross browser solution to fade a css backgrund image to greyscale and back. The only working solution is to apply CSS3 filter greyscale: -webkit-filter: grayscale(100%); but this works just with Chrome v.15+ and Safari v.6+ (as you can see here: http://css3.bradshawenterprises.com/filters/) Many pages online speaks about this solution to grey out elements: filter: url(\"data:image/svg+xml;utf8,<svg xmlns=\\\'http://www.w3.org/2000/svg\\\'>

Image Greyscale with CSS & re-color on mouse-over?

痞子三分冷 提交于 2019-11-26 06:56:30
问题 I am looking to take an icon that is colored (and will be a link) and turn it greyscale until the user places their mouse over the icon (where it would then color the image). Is this possible to do, and in a way that is IE & Firefox supported? 回答1: There are numerous methods of accomplishing this, which I'll detail with a few examples below. Pure CSS (using only one colored image) img.grayscale { filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\

Convert an image to grayscale in HTML/CSS

血红的双手。 提交于 2019-11-26 01:24:49
问题 Is there a simple way to display a color bitmap in grayscale with just HTML/CSS ? It doesn\'t need to be IE-compatible (and I imagine it won\'t be) -- if it works in FF3 and/or Sf3, that\'s good enough for me. I know I can do it with both SVG and Canvas, but that seems like a lot of work right now. Is there a truly lazy person\'s way to do this? 回答1: Support for CSS filters has landed in Webkit. So we now have a cross-browser solution. img { filter: gray; /* IE6-9 */ -webkit-filter: grayscale

Convert an image to grayscale

梦想的初衷 提交于 2019-11-26 00:55:24
问题 Is there a way to convert an image to grayscale 16 bits per pixel format, rather than setting each of the r,g and b components to luminance. I currently have a bmp from file. Bitmap c = new Bitmap(\"filename\"); I want a Bitmap d, that is grayscale version of c. I do see a constructor that includes System.Drawing.Imaging.PixelFormat, but I don\'t understand how to use that. I\'m new to Image Processing and the relevant C# libraries, but have a moderate experience with C# itself. Any help,

How can I convert an RGB image to grayscale but keep one color?

烂漫一生 提交于 2019-11-25 23:37:25
问题 I am trying to create an effect similar to Sin City or other movies where they remove all colors except one from an image. I have an RGB image which I want to convert to grayscale but I want to keep one color. This is my picture: I want to keep the red color. The rest should be grayscale. This is what my code outputs so far (you can see that the areas are correct, I don\'t know why they are white instead of red though): Here is my code so far: filename = \'roses.jpg\'; [cdata,map] = imread(

Display image as grayscale using matplotlib

旧街凉风 提交于 2019-11-25 20:47:16
I'm trying to display a grayscale image using matplotlib.pyplot.imshow() . My problem is that the grayscale image is displayed as a colormap. I need the grayscale because I want to draw on top of the image with color. I read in the image and convert to grayscale using PIL's Image.open().convert("L") image = Image.open(file).convert("L") Then I convert the image to a matrix so that I can easily do some image processing using matrix = scipy.misc.fromimage(image, 0) However, when I do figure() matplotlib.pyplot.imshow(matrix) show() it displays the image using a colormap (i.e. it's not grayscale)

Convert an image to grayscale

那年仲夏 提交于 2019-11-25 19:21:43
Is there a way to convert an image to grayscale 16 bits per pixel format, rather than setting each of the r,g and b components to luminance. I currently have a bmp from file. Bitmap c = new Bitmap("filename"); I want a Bitmap d, that is grayscale version of c. I do see a constructor that includes System.Drawing.Imaging.PixelFormat, but I don't understand how to use that. I'm new to Image Processing and the relevant C# libraries, but have a moderate experience with C# itself. Any help, reference to an online source, hint or suggestion will be appreciated. EDIT: d is the grayscale version of c.