grayscale

convert raw binary 8 bit unsigned file to 16 bit unsigned with the python imaging library

佐手、 提交于 2019-12-11 18:06:35
问题 I have an image file that is a grayscale 8 bit unsigned integer raw binary file and I need to convert it to a 16 bit file and keep it in raw binary. It is relatively easy to go from 16 to 8 because you are just cutting off information but I am curious how I can go the other way. To be specific I have an image that is going into a processor written in C++ and the processor only takes 16 bit unsigned integer image files so I need to convert my 8 bit file into a 16 bit one. I have been doing

Autodesk Design Automation API define Plot Settings e.g. greyscale/linewidth

冷暖自知 提交于 2019-12-11 14:25:52
问题 I am searching for an option to define the Plot Settings when converting a .dwg file to a .pdf file. I want to have the converted PDF in greyscale and the linewidth of the Elements is too big. How can I define the Plotsettings in my API call to Forge Design-Automation-API? Thankyou 回答1: You will need to create a custom activity to do this. If you know how to do this using the -PLOT command on the AutoCAD command line then this will be relatively easy exercise. Here's a tutorial that shows how

Reading Grayscale PNG image files without distortion

穿精又带淫゛_ 提交于 2019-12-11 12:56:53
问题 I need to read and process a large number of PNG files that are grayscale. By that I mean that if they are opened in either Photoshop or GIMP, the image mode is Grayscale - not an RGB image with grayscale values. ImageIO does not seem to achieve this. It appears to treat all image files as sRGB. This mangles grayscale values. I need to read and process these PNG files where (in my code) each pixel has exactly the same value as if I had opened the grayscale file in Photoshop or GIMP. Does

Colormap and GIF images in Matlab

不想你离开。 提交于 2019-12-11 11:12:12
问题 I have a problem understanding colormaps in Matlab and using them to import and diplay .gif images. I would like to import an image using im = imread('I.gif') and then display it using imshow(im) but the result is wrong If I do [im,map] = imread('I.gif') and then display it using imshow(im,map) it works properly, but still I don't understand the need of this colormap Is there a way to import and convert my gif image to greyscale so that when I do imshow(im) it shows the correct greyscale

When I write the image it appears black

被刻印的时光 ゝ 提交于 2019-12-11 08:47:30
问题 I have a program that returns a grayscale image. But, when I try to write the image, it appears totally black . Why is that? How can I write the image and get the expected result? Thanks. 回答1: First check on the type of your data. You can cast the type of the data by example double() or uint16() etc. (Check the help for typecasting). Here is an example how you rescale your values to the intensity-range of uint16, unsigned integers with ~65k possible different values. The casting of course

CSS3 grayscale filter looks different on different images

江枫思渺然 提交于 2019-12-11 07:15:41
问题 I have 3 icons of FCB, twitter and RSS and I want them to be grayscale but on hover they should change to color version. It is working great but these 3 images looks a bit different in grayscale. Is there a way to make them looks the same? This is my code for grayscale: img.grayscale{ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0

GrayScale (by ColorMatrix) causes OutOfMemoryException. Why?

戏子无情 提交于 2019-12-11 03:29:42
问题 I have 2 forms, A and B. On the Form A, I click a button and an Image is being loaded to a PictureBox located ona the Form B. And, I want to set GrayScale to this image by: public void SetGrayScale(PictureBox pb) { ColorMatrix matrix = new ColorMatrix(new float[][] { new float[] {0.299f, 0.299f, 0.299f, 0, 0}, new float[] {0.587f, 0.587f, 0.587f, 0, 0}, new float[] {0.114f, 0.114f, 0.114f, 0, 0}, new float[] { 0, 0, 0, 1, 0}, new float[] { 0, 0, 0, 0, 0} }); Image image = (Bitmap)pb.Image

Detailed Calculation of RGB to Graylevel by Mathematica

青春壹個敷衍的年華 提交于 2019-12-10 19:59:01
问题 I tried ColorConvert[img, "Grayscale"] to convert the RGB to Graylevel . I am wondering the detailed calculation by mathematica.. Gray level= square(R^2+G^2+B^2)? or something else? 回答1: We can obtain the exact values used by mathematica by making up a 3 pixel image with pure red,green,blue and converting it: lvec = First@ ImageData[ ColorConvert[Image[{{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}}], "GrayScale"]] {0.299, 0.587, 0.114} Note these are the "Rec. 601 luna coefficients" per http://en

Converting RGB images to grayscale

孤者浪人 提交于 2019-12-10 12:26:56
问题 I'm new on programming. I'm a student in a univesity. Is it possible to use visual studio for converting RGB images to grayscale with C#? There is a specific folder that includes RGB jpeg images and every day it has new jpg files too. I need to make an exe file for converting them to grayscale. Do I have to install new libraries for this work or are standard libraries of VS2013 enough for this? 回答1: The standard libraries are enough. I once used this code: public static Bitmap GrauwertBild

What grayscale conversion algorithm does OpenCV cvtColor() use?

↘锁芯ラ 提交于 2019-12-10 02:01:40
问题 When converting an image in OpenCV from color to grayscale, what conversion algorithm is used? I tried to look this up in the source code on GitHub, but I did not have any success. The lightness method averages the most prominent and least prominent colors: (max(R, G, B) + min(R, G, B)) / 2. The average method simply averages the values: (R + G + B) / 3. The luminosity method is a more sophisticated version of the average method. It also averages the values, but it forms a weighted average to