pixel

Make a 2D pixel plot with matplotlib

落爺英雄遲暮 提交于 2019-11-27 07:17:11
I got the following data from some calculations: x, y, temp where x and y are the coordinates of a point in a 2D box of dimensions 10x10. Spacing is equal to 0.1. So there are 10000 different points and the resulting file looks like: 0.0 0.0 5.6 0.1 0.0 3.2 0.2 0.0 4.1 ... 9.9 9.9 2.1 I would like to prepare kind of a 2D plot with matplotlib, with 100x100 pixels, where each pixel gets a colour (rainbow colors going from red to violet, from the minimum to the maximum values of the third column) according to the value of the 3rd column, and data is read from this file. I wonder what is the best

iOS: Get pixel-by-pixel data from camera

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 07:08:50
I'm aware of AVFoundation and its capture support (not too familiar though). However, I don't see any readily-accessible API to get pixel-by-pixel data (RGB-per-pixel or similar). I do recall reading in the docs that this is possible, but I don't really see how. So: Can this be done? If so, how? Would I be getting raw image data, or data that's been JPEG-compressed? AV Foundation can give you back the raw bytes for an image captured by either the video or still camera. You need to set up an AVCaptureSession with an appropriate AVCaptureDevice and a corresponding AVCaptureDeviceInput and

Draw a single pixel on Windows Forms

陌路散爱 提交于 2019-11-27 07:02:02
I'm stuck trying to turn on a single pixel on a Windows Form. graphics.DrawLine(Pens.Black, 50, 50, 51, 50); // draws two pixels graphics.DrawLine(Pens.Black, 50, 50, 50, 50); // draws no pixels The API really should have a method to set the color of one pixel, but I don't see one. I am using C#. This will set a single pixel: e.Graphics.FillRectangle(aBrush, x, y, 1, 1); The Graphics object doesn't have this, since it's an abstraction and could be used to cover a vector graphics format. In that context, setting a single pixel wouldn't make sense. The Bitmap image format does have GetPixel()

Pixel-perfect shader in Unity ShaderLab

浪子不回头ぞ 提交于 2019-11-27 06:42:29
问题 In Unity, when writing shaders, is it possible for the shader itself to "know" what the screen resolution is, and indeed for the shader to control single physical pixels? I'm thinking only of the case of writing shaders for 2D objects (such as for UI use, or at any event with an ortho camera). (Of course, normally to show a physical-pixel perfect PNG on screen, you merely have a say 400 pixel PNG, and you arrange scaling so that the shader, happens to be drawing to, precisely 400 physical

putImageData(), how to keep old pixels if new pixels are transparent?

烈酒焚心 提交于 2019-11-27 06:13:21
问题 In html5, when you draw to a canvas using putImageData(), if some of the pixels you are drawing are transparent (or semi-transparent), how do you keep old pixels in the canvas unaffected? example: var imgData = context.createImageData(30,30); for(var i=0; i<imgData.data.length; i+=4) { imgData.data[i]=255; imgData.data[i+1]=0; imgData.data[i+2]=0; imgData.data[i+3]=255; if((i/4)%30 > 15)imgData.data[i+3] = 0; } context.putImageData(imgData,0,0); The right half of the 30x30 rect is transparent

移动端

蹲街弑〆低调 提交于 2019-11-27 05:05:22
css3的 -webkit-min-device-pixel-ratio属性 解决高清的适配 bg-image($url) background-image: url($url + "@2x.png") @media (-webkit-min-device-pixel-ratio: 3),(min-device-pixel-ratio: 3) background-image: url($url + "@3x.png") 来源: https://www.cnblogs.com/webljl/p/11345473.html

Size of zero pixels in CSS with or without 'px' suffix? [duplicate]

与世无争的帅哥 提交于 2019-11-27 04:32:41
问题 This question already has an answer here: 'property: 0' or 'property: 0px' in CSS? 9 answers Googling for the answer to this question has proven difficult so I figured somebody here should know. Within CSS, I've seen zero pixels declared as simply '0' yet also as '0px'. mystyle { width: 0; } anotherstyle { width: 0px; } The minor problem with '0' is that if you change it to some non-zero value, you might forget to add the 'px'. And when making a value '0', you may forget to remove the 'px'. I

Get pixel color from an image

落花浮王杯 提交于 2019-11-27 04:15:47
问题 I have an image on a browser. I want to get the top left pixel of the image color (at coordinates: 0,0), no matter whether the image is rotated or not. How can I do that, using javascript or php code? 回答1: Create a canvas document.createElement Get the 2d context canvas.getContext('2d') Draw the image to the canvas context.drawImage(image, x, y) Make sure the image is from the same domain or you won't have access to its pixels Get the pixel data for the image context.getImageData(x1, y1, x2,

Getting the pixel value of BMP file

大城市里の小女人 提交于 2019-11-27 03:33:53
问题 i got a question for reading an bmp image. How can i get the pixel value(R, G, B values) in an bmp image? Can anyone help me using the C programming language? 回答1: The easy way would be to find a good image manipulation library for your chosen platform and use that. Linux ImLib / GDK-Pixbuf (Gnome/GTK) / QT Image (KDE/Qt) should be able to do what you need. Windows I'm not familiar with the appropriate system library, but an MSDN Search for "Bitmap" is probably a good place to start. Mac OSX

Swing and bitmaps on retina displays

馋奶兔 提交于 2019-11-27 03:33:22
问题 I've got a Java desktop app that works, amongst other, on OS X. Now the new MacBook Pro has a retina display and I'm concerned: how is it going to work regarding Swing? What about when a Java app uses both Swing components and some bitmap graphics (like custom icons / ImageIcon)? Shall all desktop Java apps be automatically resized (for example by quadrupling every pixel) or am I going to need to create two versions of my icons set (for example one with 24x24 icons and the other with 96x96