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
23
votes
6 answers

Line rasterisation: Cover all pixels, regardless of line gradient?

Basically, I want to use a line algo to determine which cells to check for collisions for my raycaster. Bresenham isn't great for this as it uses a unified-thickness approach, meaning that it ignores cells that aren't at least half-covering the…
Steffan Donal
  • 2,244
  • 4
  • 24
  • 47
23
votes
1 answer

Is it possible to change the color of one individual pixel in Python?

I need python to change the color of one individual pixel on a picture, how do I go about that?
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
23
votes
3 answers

Can you have multiple pixel (fragment) shaders in the same program?

I would like to have two pixel shaders; the first doing one thing, and then the next doing something else. Is this possible, or do I have to pack everything into the one shader?
Harry
  • 3,076
  • 4
  • 28
  • 44
23
votes
2 answers

Get pixel color from an image

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?
Eitan
  • 1,286
  • 2
  • 16
  • 55
23
votes
2 answers

python tkinter: how to work with pixels?

using google (and this site) i have seen some similar questions but my problem is still here: "i want to draw an image (without reading a file) , being able to manipulate every single pixel's colour in that image." i have seen another question where…
Alberto Perrella
  • 1,318
  • 5
  • 12
  • 19
22
votes
1 answer

How to display pixels on screen directly from a raw array of RGB values faster than SetPixel()?

I enjoy making "animations" in c++ such as a MandelBrot Set zoomer, Game of Life simulator etc. by setting pixels directly to the screen frame-by-frame. The SetPixel() command makes this incredibly easy, although unfortunately it's also painfully…
Can_of_awe
  • 1,431
  • 1
  • 11
  • 17
22
votes
3 answers

How to Change Pixel Color of an Image in C#.NET

I am working with Images in Java, I have designed more over 100+ images(.png) format, They were all Trasparent and Black Color Drawing. The problem is, Now I have been asked to change the color of the Drawing (Black -to ). I have searched many code…
Bibi Tahira
  • 1,082
  • 5
  • 15
  • 39
21
votes
3 answers

what is display's logical resolution?

I encountered this concept: device pixel ration, some said it is the ratio between physical pixels and logical pixels. For example iPhone has: Physical resolution: 960 x 640 Logical resolution: 480 x 320 so does it mean that the height of each…
Blake
  • 7,367
  • 19
  • 54
  • 80
21
votes
1 answer

blurring an image using PIL in python

I have been trying to blur an image using the PIL. from what I know i need to copy the image, and then change every pixel to the average of the pixels surrounding him, from the original picture. so I didn't get really far, i'm using python 3.3x from…
Mumfordwiz
  • 1,483
  • 4
  • 19
  • 31
20
votes
9 answers

Pixel to MM equation?

Is there a reliable equation to work out pixel size to MM? Or is that not possible cross device? We are working with a bespoke system that delivers content to many devices with different screen sizes, it can detect the screen width in MM, but we…
Dancer
  • 17,035
  • 38
  • 129
  • 206
20
votes
7 answers

Commonly used pixel sizes for webpages and their pros/cons

What are the most commonly used pixel sizes (primarily widths) and what are there advantages and disadvantages? How can I best find a happy medium to give a good experience to people with a wide variety of monitor sizes? An answer with an…
Nachshon Schwartz
  • 15,289
  • 20
  • 59
  • 98
20
votes
2 answers

How can I stretch bitmap in WPF without smoothing pixels

I'm working on SEM image processing application, written in WPF. I have an image display control, derived from Canvas, which displays image & overlays using DrawingVisuals (one for each "layer"). It also implements Zoom & Pan using scale & translate…
Zbynek Vrastil
  • 201
  • 2
  • 3
19
votes
2 answers

Flutter screen size calculation

I am getting sick trying to adapt my app to a certain tablet dimensions using flutter. The tablet is a Samsung Galaxy Tab S5e with screen of 2560x1600. When I make flutter return the screen dimensions using: print("Size W is…
codeKiller
  • 5,493
  • 17
  • 60
  • 115
19
votes
4 answers

Relation between dp - sp and PX

I am not asking what is the difference between dp,sp and px. I am designing a website based on google's new material design, all the measurements are in dp (for grid) and sp(for text). My question is how do they translate to pixels. I have been…
chandan
  • 1,574
  • 4
  • 23
  • 52
19
votes
2 answers

swscaler warning : deprecated pixel format used

I want to perform a color space conversion of my video frame before converting it to an opengl texture with the following code: struct SwsContext * pSwsCtx = sws_getCachedContext(NULL,width, height, codec->pix_fmt, width, height, AV_PIX_FMT_RGBA,…
Martin Delille
  • 11,360
  • 15
  • 65
  • 132