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
18
votes
3 answers
Bitmap width/height different after loading from Resource
1st. i'am new to Android coding :)
What I do is I load an Bitmap from my res/drawable-mdpi with
BitmapFactory.decodeResource(getResources(), R.drawable.cat_ground_01);
after I Log out the width/height of the Bitmap it tells me an other value then…

X-Tender
- 183
- 1
- 1
- 4
18
votes
5 answers
Quickly getting the color of some pixels on the screen in Python on Windows 7
I need to get the color of some pixels on the screen or from the active window, and I need to do so quickly. I've tried using win32gui and ctypes/windll, but they're much too slow. Each of these programs gets the color of 100 pixels:
import…

dln385
- 11,630
- 12
- 48
- 58
18
votes
5 answers
Qt/C++ : drawing efficiently
I have designed a program which, basically, cuts a geometrical shape into many small triangles (in a "left canvas"), applies some simple mathematical transformation to the bunch of triangles, and redraws them in their new configuration. See screen…

Seub
- 2,451
- 4
- 25
- 34
17
votes
3 answers
iOS -- detect the color of a pixel?
For example, suppose I want to detect the color of the pixel with screen coordinates (100, 200). Is there a way to do this?
EDIT -- I'm not worried about retina display issues for now.

William Jockusch
- 26,513
- 49
- 182
- 323
17
votes
7 answers
How do I draw a point using Core Graphics?
I see APIs in Quartz for drawing lines and circles. But all I want to do is to specify the (x,y) cartesian coordinate to color a pixel a particular value. How do I do that?
Siddharth
17
votes
3 answers
Why use rem instead px when it's the same anyway?
Okay, first off, yes I have read many many articles (Should I use px or rem value units in my CSS?) and forums about this.
I know that 1px is not a physical pixel but rather a CSS pixel, and rem is basically the same as em, but it is relative to the…

Kevin M
- 1,202
- 15
- 30
17
votes
6 answers
C++ Pixels In Console Window
In C++ using Code::Blocks v10.05, how do I draw a single pixel on the console screen? Is this easy at all, or would it be easier to just draw a rectangle? How do I color it?
I'm sorry, but I just can't get any code from SOF, HF, or even…

hCon
- 207
- 1
- 7
- 19
16
votes
2 answers
php gd pixelate too sharp
i have this script for pixelize my images the script is working but i want more smooth edges:
$imgfile = 'batman.jpg';
$image = ImageCreateFromJPEG($imgfile);
$imagex = imagesx($image);
$imagey = imagesy($image);
$pixelate_amount = 10;
$tmpImage =…

lasers
- 285
- 1
- 10
16
votes
3 answers
How to draw a pixel on the screen directly?
I'm wanting to do something like the following:
...
pixel[0,0] = [ 254, 0, 0 ] # Draw R at pixel x0y0
pixel[2,1] = [ 0, 254, 0 ] # Draw G at pixel x2y1
pixel[4,2] = [ 0, 0, 254 ] # Draw B at pixel x4y2
...
I hope to display many different…

Matthieu Cartier
- 2,361
- 4
- 17
- 15
16
votes
1 answer
python -- measuring pixel brightness
How can I get a measure for a pixels brightness for a specific pixel in an image? I'm looking for an absolute scale for comparing different pixels' brightness. Thanks

Double AA
- 5,759
- 16
- 44
- 56
16
votes
4 answers
Javascript generate transparent 1X1 pixel in dataURL format
I would like to know a way to generate a single pixel in JavaScript converting it to base64. The ideal function would be:
function createPixel(hexColor, opacity){
//...Calculate
return base64DataURL;
}
I am not very familiar with image…

user654628
- 1,429
- 1
- 17
- 37
16
votes
5 answers
How is font size calculated?
I have a complex js function with an equation in which I actually need to understand how much space in pixels font sizes take up.
I have noticed that some font's sizes are different depending on the font.
How is a font's size calculated? If its set…

Mechlar
- 4,946
- 12
- 58
- 83
16
votes
4 answers
How to color a pixel?
I have to create a simple 2D animation without using various primitives for drawing line, circle etc for the purpose. It has to be done by manipulating pixels and implementing one of the algorithms for drawing line, circle etc by coloring pixels.
I…

razor35
- 333
- 3
- 4
- 11
16
votes
2 answers
Browsers truncate border values to integers
Whenever a non-integer pixel value is used for the border of an element, the browser simply truncates the value to become an integer. Why is this the case?
I'm aware that the border will not actually take up part of a pixel, but these types of…

Anonymous
- 11,748
- 6
- 35
- 57
16
votes
4 answers
extracting a quadrilateral image to a rectangle
BOUNTY UPDATE
Following Denis's link, this is how to use the threeblindmiceandamonkey code:
// the destination rect is our 'in' quad
int dw = 300, dh = 250;
double in[4][4] = {{0,0},{dw,0},{dw,dh},{0,dh}};
// the quad in the source image is our…

Will
- 73,905
- 40
- 169
- 246