pixel

Find color name when have Hue in android

旧城冷巷雨未停 提交于 2019-12-04 14:48:03
问题 I only care about 12 colors: red: RGB: 255, 0, 0 pink: RGB: 255, 192, 203 violet: RGB: 36, 10, 64 blue: RGB: 0, 0, 255 green: RGB: 0, 255, 0 yellow: RGB: 255, 255, 0 orange: RGB: 255, 104, 31 white: RGB: 255, 255, 255 black: RGB: 0, 0, 0 gray: RGB: 128, 128, 128 tea: RGB: 193, 186, 176 cream: RGB: 255, 253, 208 When i read the pixel of bitmap, i can get the Hue value: int picw = mBitmap.getWidth(); int pich = mBitmap.getHeight(); int[] pix = new int[picw * pich]; float[] HSV = new float[3]; /

How can access to pixel data with PYQt' QImage scanline()

空扰寡人 提交于 2019-12-04 14:05:34
I need to access the pixel data in a qimage object with PyQt4. The .pixel() is too slow so the docs say to use the scanline() method. In c++ I can get the pointer returned by the scanline() method and read/write the pixel RGB value from the buffer. With Python I get the SIP voidptr object that points to the pixels buffer so I can only read the pixel RGB value using bytearray but I cannot change the value in the original pointer. Any suggestions? Luke Here are some examples: from PyQt4 import QtGui, QtCore img = QtGui.QImage(100, 100, QtGui.QImage.Format_ARGB32) img.fill(0xdeadbeef) ptr = img

C# - Converting 8-bit or 16-bit grayscale raw pixel data

a 夏天 提交于 2019-12-04 13:57:59
I need to be able to convert 8-bit or 16-bit grayscale pixel data into a file format that the .NET framework can support. The data I have available is the width, height, orientation (bottom-left) and the pixel format as 4096 shades of gray (12-bit resolution) packed in 2 bytes per pixel. So for example each pixel ranges from 0 to 4096, and each pixel is 2 bytes. I have already tried using PixelFormat.Format16bppGrayScale with the Bitmap constructor, and it throws a GDI+ exception. Everything I have read says that this format is not supported and that MSDN is wrong. I want to convert this pixel

Calculating pixel length of an image

谁说胖子不能爱 提交于 2019-12-04 12:55:15
May I know what are the ways to calculate the length of 1 pixel in centimeters? The images that I have are 640x480. I would like to compare 2 pixels at different places on the image and find the difference in distance. Thus I would need to find out what's the length of the pixel in centimeters. Thank you. A pixel is a relative unit of measure, it does not have an absolute size. Edit . With regard to your edit: again, you can only calculate the distance between two pixels in an image in pixels, not in centimeters. As a simple example, think video projectors: if you project, say, a 3×3px image

IplImage Pixel Access JavaCV

≡放荡痞女 提交于 2019-12-04 12:22:34
问题 I'm trying to access Pixel by Pixel of an IplImage. Im using Java and Processing, and sometimes I need to access pixel by pixel. I've done this so far, but I don't know what's wrong: public IplImage PImageToIplImage(PImage imageSrc) { IplImage imageDst; if(imageSrc.format==RGB) { imageDst = IplImage.create(imageSrc.width, imageSrc.height, IPL_DEPTH_8U, 3); ByteBuffer imagePixels=imageDst.getByteBuffer(); int locPImage, locIplImage, x, y; for(y=0; y<imageSrc.height; y++) for(x=0; x<imageSrc

What could cause the same browser on different PCs to render the same HTML differently?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 11:45:30
问题 I'm stumped. A client and I are both running Firefox 3.0.12 on XP machines. We view the same page in the same browser on different machines and have different results. Note: All IE browsers are consistent on both of machines, and my FF 3.5.1 is consistent with my FF 3.0.12. (He does not have FF 3.5.x installed to compare with). There is a 1 pixel difference that causes his header div (all images, no text) to wrap. Mine is fine. If I expand his header by 1 px (via Firebug css editing), it

Painting pixels images in Java

空扰寡人 提交于 2019-12-04 11:28:29
问题 Which method is the best way to create a pixel image with java. Say, I want to create a pixel image with the dimensions 200x200 which are 40.000 pixels in total. How can I create a pixel from a random color and render it at a given position on a JFrame. I tried to create a own component which just creates pixel but it seems that this is not very performant if I create such a pixel a 250.000 times with a for-loop and add each instance to a JPanels layout. class Pixel extends JComponent {

Is it wise to use fractional / decimal pixels for borders in css?

心已入冬 提交于 2019-12-04 11:04:31
问题 I have various instances in my design that call for border-right: 1.5px solid black; border-bottom: 1.5px solid black; etc... I also have design that needs thinner lines: at 1px . However, it seems the browser may round the decimal, as I'm not seeing much differentiation between the two (if any). Should I just be using 2px and 1px instead, or is there a better way to pull this off? A designer I'm helping is very adamant about the 1.5px line width. Any help, much appreciated. 回答1: You can use

Web Layouts: pixels vs percentages

走远了吗. 提交于 2019-12-04 10:52:31
What are the use cases for defining distances in a web layout for pixels and percentages? Is there any downside to using pixels with respect to multiple resolutions? Will they scale correctly? Percentage layout This is generally referred to as fluid layout. Your elements will take a defined percentage of the total space available to them. This available space is determined by the element's parent. When using percentage layouts, it's a good idea to specify a min-width and max-width on your design so that it remains usable at very low and high resolutions. Pros Scales with screen size, therefore

Dynamically pixelate an html image element

。_饼干妹妹 提交于 2019-12-04 09:59:42
I'm to take an image on a webpage, and then use javascript (or whatever would be best suited) to dynamically 'pixelate' it (e.g. into 20px squares). Then, as the user scrolls down the page, I need the image to gradually increase in resolution, till it is no longer pixelated. Any ideas how I could go about doing this? I realise I could use php to resize an image and several times and just switch out the image, but that would require loading several extra images. Also, I know I could probably do the effect with flash & pixelbender, but I want to achieve it within the limitations of HTML5, CSS &