Questions tagged [pixel]

A pixel is the smallest unit that can be represented or controlled on a display. The word pixel is derived from the phrase "picture element".

4067 questions
14
votes
2 answers

how to get color at the spot(or pixel) of a image on touch event in android

I want to get the color of the spot or pixel where I will touch a image in Android. I searched a lot on net, but got nothing. Please anyone help me.
Shirish Herwade
  • 11,461
  • 20
  • 72
  • 111
14
votes
3 answers

The use of getPixels() of Android's Bitmap class and how to use it

I'm trying to do some image processing in Android. I need to get a chunk of pixel information of a bitmap. So I tried to use one of the Bitmap class method getPixels(). However, it seems like I'm not using it correctly or I misunderstood of the sole…
YoonSoo Lee
  • 167
  • 1
  • 2
  • 6
13
votes
2 answers

What's the theory behind computing variance of an image?

I am trying to compute the blurriness of an image by using LaplacianFilter. According to this article: https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/ I have to compute the variance of the output image. The problem is I don't…
denis631
  • 1,765
  • 3
  • 17
  • 38
13
votes
2 answers

Swift - Compare colors at CGPoint

I have 2 pictures which I want to compare, if pixel color is the same to save it. I detect the color of the pixel by this UIImage extension function: func getPixelColor(pos: CGPoint) -> ??? { let pixelData =…
Bogdan Bogdanov
  • 882
  • 11
  • 36
  • 79
13
votes
0 answers

How to rasterize OpenGL triangle on half-integer pixels centers

OpenGL pixels/fragments are conceptually 1x1 squares centered on half-integer pixels. The OpenGL 4.5 specification states: A fragment is located by its lower left corner, which lies on integer grid coordinates. Rasterization operations also refer…
wcochran
  • 10,089
  • 6
  • 61
  • 69
13
votes
3 answers

How can I get the color of a screen pixel THROUGH ADB

I need to get the color information of a specific point on screen of my android phone. Is there a way to do that through ADB? I am now using the build-in command screencap to capture the whole screen and then read the color of the specific point.…
superweijiafeng
  • 559
  • 1
  • 4
  • 12
13
votes
2 answers

How do I figure out what size (in pixels) an image needs to be for Android to display that image correctly across devices?

I have two images I want to display within my app. The first image is to be full screen (as a background for the app). I have read the 'Supporting Multiple Screens' article on developers.android.com multiple times but, I am still at a loss as to…
netman74501
  • 151
  • 1
  • 9
13
votes
3 answers

Get string length in pixels using JavaScript

I want to know exact length in pixels of String i.e. "Hello World". It should not be length of my container. Any Help???
Kundan Atre
  • 3,853
  • 5
  • 26
  • 39
12
votes
3 answers

What's the best way to "round" a Color object to the nearest Color Constant?

I will be retrieving the exact color of a pixel and would like to relate that exact color to a constant like Color.blue. Is there an easy way to "round" to the nearest Color Constant? Additionally, is there a way to define your own Color…
Stormbreaker
  • 133
  • 1
  • 5
12
votes
2 answers

How to replace all pixels of a certain RGB value with another RGB value in OpenCV

I need to be able to replace all pixels that have a certain RGB value with another color in OpenCV. I’ve tried some of the solutions but none of them worked for me. What is the best way to achieve this?
SJS
  • 139
  • 1
  • 3
  • 13
12
votes
3 answers

How to create empty/blank UIImage or CGImage and manipulate pixels on it (Xcode)?

I have following problem and only could solve it partially yet. I am working with XCode 3.2.5, developing for iOS 4+. I simply try to create an Image of pre-defined size, manipulate pixels on it and then show the Image in an UIImageView. My view…
EliteTUM
  • 705
  • 2
  • 8
  • 21
12
votes
3 answers

Pixel access in OpenCV 2.2

Hi I want to use opencv to tell me the pixel values of a blank and white image so the output would look like this 10001 00040 11110 00100 Here is my current code but I'm not sure how to access the results of the CV_GET_CURRENT call.. any help…
macarthy
  • 3,074
  • 2
  • 23
  • 24
12
votes
4 answers

How to convert dp to px in xamarin.android?

I want to convert dp to px in my C# code in xamarin.android, but all I could find were java codes in android studio that have some problems in xamarin. I tried to use equivalent like using Resources instead of getResources() and I could solve some…
12
votes
4 answers

Pixel-perfect shader in Unity ShaderLab

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…
Fattie
  • 27,874
  • 70
  • 431
  • 719
12
votes
2 answers

What does half a pixel mean in the font-size CSS property?

I'm currently working on a website redesign and I'm receiving a list with the required changes from an agency. The header menu of the site currently has the following styles: line-height: 1em; font-size: 11px; In one of the documents I have…