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".
Questions tagged [pixel]
4067 questions
16
votes
1 answer
Does floating point length value make sense on pixel unit?
When I try write stylish CSS for forums.asterisk.org site, I saw they use floating point length value on pixel unit, for example: font-size: 13.1px;.
As far as I known, pixel is the smallest unit in screen, so does floating point length value make…

LiuYan 刘研
- 1,614
- 1
- 16
- 29
16
votes
4 answers
How to create and implement a pixel tracking code
OK, here's a goal I've been looking for a while.
As it's known, most advertising and analytics companies use a so called "pixel" code in order to track websites views, transactions, conversion etc.
I do have a general idea on how it works, the…

Andrei Stalbe
- 1,511
- 6
- 26
- 44
16
votes
3 answers
How to draw a pixel on the screen in protected mode in x86 assembly?
I am creating a little bootloader+kernel and till now I managed to read disk, load second sector, load GDT, open A20 and enable pmode.
I jumped to the 32-bits function that show me a character on the screen, using the video memory for textual…

ali
- 10,927
- 20
- 89
- 138
15
votes
1 answer
C# Getting the pixel data efficiently from System.Drawing.Bitmap
I have several (~2GB) raw 24bpp RGB files on HDD.
Now I want to retrieve a portion of it and scale it to the desired size.
(The only scales allowed are 1, 1/2, 1/4, 1/8, ..., 1/256)
So I'm currently reading every line from the rectangle of interest…

Arokh
- 614
- 1
- 10
- 18
15
votes
3 answers
How to convert Android's DP to Flutter's LP? What is the difference between DP and LP?
I got the designs for a new app. All the dimensions are Android-ready and are given in DP - (Density-independent Pixels). How can I convert these values to Flutter's LP (Logical Pixels).
I know that Window.devicePixelRatio gives me the number of…

kosiara - Bartosz Kosarzycki
- 10,922
- 12
- 70
- 83
15
votes
1 answer
Why does Bootstrap use a 0.02px difference between screen size thresholds in its media queries?
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) and (max-width: 767.98px) { ... }
// Medium devices (tablets, 768px and…

clickbait
- 2,818
- 1
- 25
- 61
15
votes
2 answers
Convert lat/lon to pixels and back
I'm using google maps in my application, and I have a webserver with a databse filled with lat/lon values. I want to mark them on the map, but I also want to cluster them together if they are within a certain pixel-distance of eachother.
I figure if…

AmITheRWord
- 1,363
- 2
- 14
- 36
15
votes
3 answers
How to define clear range for pixel color
What I'm trying to do is to test if a pixel is blue or not.
For example: The blue color is in RGB defined as rgb(0,0,255). Typical color depths are 8 bit (256 colours), 16 bit (about 65 thousand), 24 bit (about 16 million) and 32 bit (over 4 billion…

Jürgen K.
- 3,427
- 9
- 30
- 66
14
votes
1 answer
How to draw OpenCL calculated pixels to the screen with OpenGL?
I wan't to do some calculated pixelart with OpenCL and display this directly on the display without CPU roundtripping. I could use interoperability of OpenCL with OpenGL and write to the texture-banks of the GPU and display the texture with OpenGL.…

RobotRock
- 4,211
- 6
- 46
- 86
14
votes
8 answers
Mac OS Cocoa: Draw a simple pixel on a canvas
I wish I would find an answer for this. I have searched and searched and couldn't the right answer. Here is my situation:
In a Mac OS Cocoa Application, I want to draw a pixel (actually a few pixels) onto a dedicated area on my application window. I…

Roman
- 211
- 1
- 3
- 6
14
votes
3 answers
How to change the pixel values of an Image?
I am working on an Image Processing Project and I am a beginner at Python and using PIL. Any help would be appreciated.
So, what I am doing is, I have an image of space with stars and noise. What I want to do is keep only the brighter pixels and…

Manshi Sanghai
- 283
- 2
- 3
- 10
14
votes
6 answers
How to calculate the average color of a UIImage?
I want to build an app that lets the user select an image and it outputs the "average color".
For example, this image:
The average color would be a greenish/yellowish color.
At the moment, I got this code:
// In a UIColor extension
public static…

Sweeper
- 213,210
- 22
- 193
- 313
14
votes
5 answers
Android background image size in pixel
I would like to create a background image for different resolutions in Android. So I need the values (in pixel) for ldpi, mdpi, hdpi,xhdpi and xxhdpi. It is important that the image will not be blurred.
I have already read the Documentation about…

JavaForAndroid
- 1,111
- 2
- 20
- 42
14
votes
2 answers
Draw image from pixel array on canvas with putImageData
I am working on a project that can encrypt an image and redraw the decrypted image on canvas. As I am still pretty new to coding and programming, I am currently having issues redrawing the decrypted image data, which is a pixel array in the form…

Elias Pedersen
- 173
- 1
- 1
- 9
14
votes
2 answers
How to access pixel values of CV_32F/CV_64F Mat?
I was working on homography and whenever I try to check the values of H matrix (type CV_64F) using H.at(i, j) I get random numbers(sometimes garbage value). I want to access pixel values of float matrix. Is there any way to do it?
Mat A =…

Froyo
- 17,947
- 8
- 45
- 73