grayscale

Monochrome grayscale image, get the intensity of a pixel

蹲街弑〆低调 提交于 2019-12-02 05:20:11
I'm attempting to derive an intensity value for a particular pixel in a monochrome "grayscale" image. I have some pseudocode, but thus far I've been unable to implement something that really works. /** * Retrieve the intensity value at location ('row', 'column') of the image 'img' and return it * Note: * - the 2D image is stored as an 8bit, 1D, row-major array of type byte * - the data type byte is signed in Java * - Slide 27 of chapter 2 introduces the representation of an image * @param img in row major format * @param row to evaluate * @param column to evaluate * @param width of img *

PHP: Converting png's and gif's into grayscale

孤者浪人 提交于 2019-12-02 05:04:29
问题 im using the following script to convert jpgs into grayscale-images. http://bubble.ro/How_to_convert_an_image_to_grayscale_using_PHP.html i want to upgrade it to also convert pngs (with transparency) and gifs (with transparency) into grayscale images. At the moment it's not working. I'm querying the image-src for its file-extension. If jpg, if, gif, or if png i call the appropriate imagecreatefrom-jpg-gif-png However i'm always running the same for-loop and gifs unfortunately only get gray

Convert a dynamic BitmapImage to a grayscale BitmapImage in a Windows Phone application

回眸只為那壹抹淺笑 提交于 2019-12-02 05:04:02
I would like to Convert a BitmapImage to a Grayscale BitmapImage: Which I get from a method and therefore - the Width and Height are unknown to me. I have tried looking into options such as WritableBitmapEx and static extension methods but they haven't been helpful to me as I would like the return data type to be a BitmapImage as well as I then need to add it to List. Is this possible in a Windows Phone app using C#? I would really appreciate if someone would shed some light into this. Thank you. The Algorithm is pretty simple: using System.Windows.Media.Imaging; using System.IO; private

How to convert Colors to Grayscale in java with just the java.io.*; library?

穿精又带淫゛_ 提交于 2019-12-02 03:08:23
Well, i got this.. cause in my place they request it like that.. Well i have this: //some variables and coments are a possible code.. But i mean i don't know how to do it exactly, i found on internet that to convert R is the byte is in *0.21 with G is *0.71 i guess and blue is * 0.07. I just can use that library java.io.*; and i'm working with BMP format images of 1024 x 768, if you can help me, or you want me to be more specific please tell me. i don't know if i have to add another variables or to take some out, or to modify, please help me. I'm not so new in this language, but i'm not an

Creating 8 bit image from byte array

狂风中的少年 提交于 2019-12-02 02:43:54
问题 The byte array is obtained this way - BufferedImage image = new Robot().createScreenCapture(new Rectangle(screenDimension)); byte[] array = ((DataBufferByte)getGraycaleImage(image).getRaster().getDataBuffer()).getData(); // Method getGraycaleImage returns a grayscaled BufferedImage, it works fine now how do i reconstruct this grayscale image from the byte array? I don't know much about ARGB, RGB or grayscale images. I tried this - private Image getGrayscaleImageFromArray(byte[] pixels, int

Creating 8 bit image from byte array

好久不见. 提交于 2019-12-02 00:55:08
The byte array is obtained this way - BufferedImage image = new Robot().createScreenCapture(new Rectangle(screenDimension)); byte[] array = ((DataBufferByte)getGraycaleImage(image).getRaster().getDataBuffer()).getData(); // Method getGraycaleImage returns a grayscaled BufferedImage, it works fine now how do i reconstruct this grayscale image from the byte array? I don't know much about ARGB, RGB or grayscale images. I tried this - private Image getGrayscaleImageFromArray(byte[] pixels, int width, int height) { int[] pixels2=getIntArrayFromByteArray(pixels); MemoryImageSource mis = new

PHP: Converting png's and gif's into grayscale

十年热恋 提交于 2019-12-01 23:37:17
im using the following script to convert jpgs into grayscale-images. http://bubble.ro/How_to_convert_an_image_to_grayscale_using_PHP.html i want to upgrade it to also convert pngs (with transparency) and gifs (with transparency) into grayscale images. At the moment it's not working. I'm querying the image-src for its file-extension. If jpg, if, gif, or if png i call the appropriate imagecreatefrom-jpg-gif-png However i'm always running the same for-loop and gifs unfortunately only get gray rectangles, every pixel is gray. Png's almost work, however transprency in pngs gets transformed to black

Color to grayscale on hover not working in IE11

末鹿安然 提交于 2019-12-01 16:28:50
I'm using Gray for a few elements on the site. However, I can't get it to work in IE11. For example, in the fiddle below, I use JS to add the grayscale and grayscale-fade classes so that the image fades from color to grayscale on hover. How would I get this to work in IE11? The author says that the plugin needs to be initialized for IE11 (i.e. $('article.project img').gray(); ), but if I add that line, all of the images turn gray by default from the start. I just want this to work in IE11. Can someone show me how? Fiddle: http://jsfiddle.net/61jcam54/ HTML <div id="content"> <article class=

Color to grayscale on hover not working in IE11

这一生的挚爱 提交于 2019-12-01 15:51:44
问题 I'm using Gray for a few elements on the site. However, I can't get it to work in IE11. For example, in the fiddle below, I use JS to add the grayscale and grayscale-fade classes so that the image fades from color to grayscale on hover. How would I get this to work in IE11? The author says that the plugin needs to be initialized for IE11 (i.e. $('article.project img').gray(); ), but if I add that line, all of the images turn gray by default from the start. I just want this to work in IE11.

How to send a return form a callback function to the main function

谁说胖子不能爱 提交于 2019-12-01 15:10:40
I have this fiddle http://jsfiddle.net/jdsans/38GFS/ which I was trying to workout but I could not send return for the callback function to the main function. The callback function contains end return value exactly what I want but its not returning back. When I use the document.write() function to print the return value then I get the exact value printed that I want but as I said earlier it doesn't gets returned. Please can anybody work with this fiddle to show me a working example. I have added more details in the fiddle as comments so that you don't have any problem understanding me. Looks