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
77
votes
3 answers

How to get matplotlib figure size

For a project, I need to know the current size (in pixels) of my matplotlib figure, but I can't find how to do this. Does anyone know how to do this ?
Tristan
  • 793
  • 1
  • 5
  • 5
68
votes
9 answers

Get Pixel color of UIImage

How can I get the RGB value of a particular pixel in a UIImage?
Matt S.
  • 13,305
  • 15
  • 73
  • 129
61
votes
3 answers

How to Get Pixel Color in Android

I'm using Intent to call and show an image from Gallery, and now I made it enable to get me the coordinates of the image in a TextView using these: final TextView textView = (TextView)findViewById(R.id.textView); final TextView textViewCol =…
Sean
  • 953
  • 1
  • 7
  • 26
58
votes
6 answers

No module named 'tqdm'

I am running the following pixel recurrent neural network (RNN) code using Python 3.6 import os import logging import numpy as np from tqdm import trange import tensorflow as tf from utils import * from network import Network from statistic import…
A. Syam
  • 759
  • 1
  • 6
  • 9
54
votes
3 answers

c++ and opencv get and set pixel color to Mat

I'm trying to set a new color value to some pixel into a cv::Mat image my code is below: Mat image = img; for(int y=0;y(Point(x,y)); …
grll
  • 1,047
  • 2
  • 10
  • 18
53
votes
3 answers

Android TextView setTextSize incorrectly increases text size

This is in an extension of TextView. getTextSize() and setTextSize() are not overridden, I do not extend those methods. Programming in 1.6, API level 4. The loop in this code causes size to be multiplied by 1.5 every time it iterates, e.g. if size…
Nathan Fig
  • 14,970
  • 9
  • 43
  • 57
53
votes
6 answers

How to read the Color of a Screen Pixel

Okay, I am looking for a function or something that will read the color of a certain pixel on my monitor, and when that color is detected, another function will be enabled. I figure using RGB. All help appreciated. Thank You.
Brandon
  • 555
  • 1
  • 6
  • 7
52
votes
8 answers

Pixels vs. Points in HTML/CSS

When creating an HTML page, should I specify things like margins with pixels or with points in CSS? Is one of them considered to be better practice than the other? Any advantages or disadvantages to either one?
user541686
  • 205,094
  • 128
  • 528
  • 886
47
votes
3 answers

Poor resolution in knitr using Rmd

I have a .Rmd file and I am trying to create a .docx file via the function pandoc. I want to have a figure with final resolution of 504x504 pixels (i.e., 7x7inch with 72dpi). Unfortunately, the default 72 dpi is too poor in quality, and I would…
dbarneche
  • 645
  • 1
  • 5
  • 8
47
votes
7 answers

Fast work with Bitmaps in C#

I need to access each pixel of a Bitmap, work with them, then save them to a Bitmap. Using Bitmap.GetPixel() and Bitmap.SetPixel(), my program runs slowly. How can I quickly convert Bitmap to byte[] and back? I need a byte[] with length = (4 * width…
AndreyAkinshin
  • 18,603
  • 29
  • 96
  • 155
46
votes
5 answers

Position of Div in relation to the Top of the Viewport

I am wondering how I can get the number of pixels (or measurement in general) from a div to the top of the window in Javascript. I am not looking for an offset y in relation to the document, simply to the top of where the browser is displaying. I…
individualtermite
  • 3,615
  • 16
  • 49
  • 78
46
votes
6 answers

Developing a tracking pixel

I am trying to build a pixel that would track the current URL the user is on when they visit. I can use either JS (preferred) or a 1x1 image pixel. With JS I am assuming that I'd need to run an AJAX request to a PHP script to capture the info that I…
AXM
  • 806
  • 1
  • 9
  • 24
46
votes
4 answers

What are pixels and points in iOS?

from UIImage reference: @property(nonatomic, readonly) CGSize size The dimensions of the image, taking orientation into account. Discussion In iOS 4.0 and later, this value reflects the logical size of the image and is measured in points. In iOS…
eugene
  • 39,839
  • 68
  • 255
  • 489
41
votes
5 answers

How to change a particular color in an image?

My question is if I have a Lion image just I want to change the color of the lion alone not the background color. For that I referred this SO question but it turns the color of whole image. Moreover the image is not looking great. I need the color…
Aravindhan
  • 15,608
  • 10
  • 56
  • 71
38
votes
2 answers

What is the current state of sub-pixel accuracy in the major browsers?

I'm working on a drawing application which requires high levels of accuracy, and I'm wondering which of the major browser platforms (including the HTML Canvas element, and Flash) give the best sub-pixel layout accuracy, both for drawn elements…
Jude Fisher
  • 11,138
  • 7
  • 48
  • 91