Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why pixels is float?

Tags:

java

android

All methods of Canvas class using coordinates in float type. But why? As I know this coordinates mean count of pixels to point on display. Pixel can be separated?

like image 632
BArtWell Avatar asked Apr 08 '14 16:04

BArtWell


People also ask

Can pixel values be floating point?

We can represent pixels as either unsigned eight bit integers which would occupy a single byte of computer memory each, and they have a numeric range of 0 and 255. Or we can represent them as double precision floating point numbers—they occupy eight bytes of computer storage each.

Are pixels integers?

The most common pixel format is the byte image, where this number is stored as an 8-bit integer giving a range of possible values from 0 to 255.

What is pixel center?

In Photutils, integer pixel coordinates fall at the center of pixels and they are 0-indexed, matching the Python 0-based indexing. That means the first pixel is considered pixel 0 , but pixel coordinate 0 is the center of that pixel.


1 Answers

Some devices support subpixel accuracy.


On a standard LCD screen, a pixel is really three subpixels, one red, one green, one blue. (Red Green Blue). And rendering at the subpixel level allows for sharper, better looking images.

As a crude example, rather than specifying the location of one white "RGB" pixel on the screen, there's opportunity to more closely render a white "pixel" in a slightly different location on the screen by actually using two pixels on the screen.

Consider three RGB pixels on the screen. Consider the display of a white pixel by lighting the R,G and B subpixels on pixel two:

one   two   three 
----- ----- -----
_ _ _ R G B _ _ _

and compare that to rendering by subpixel:

one   two   three
----- ----- -----
_ _ B R G _ _ _ _
_ _ _ R G B _ _ _ 
_ _ _ _ G B R _ _ 

To the human eye, all of those look like a white pixel, but subpixel rendering allows for greater control over placement. And this technique of lighting just portions of pixels, and lighting portions of adjacent pixels is effective in "line smoothing" (anti-aliasing).

And there are other screen technologies other than the traditional RGB stripe LCD. Consider, for example the variety of RGBG Amoled format screens (Samsung Galaxy displays).

like image 95
spencer7593 Avatar answered Oct 14 '22 23:10

spencer7593