[转载] Image Pixels
Image Pixels
Pictures that are printed or that are displayed on a digital screen like a monitor or are simply in digital form are made up of thousands of tiny dots, each of a single colour. When these dots are printed, they are simply called dots. But when they are digital, such as when displayed on a monitor or captured on your digital camera, they are called pixels.
The word 'pixel' is really just a shortening for 'picture element' meaning one single one of those tiny digital dots that is a single colour. Pixels of different colours are placed alongside each other to give the impression of a continuous change in tone representing colours and shades very much like what we see in reality with the naked eye.
目录:
'Pixels' and 'Dots'
What pixels contain
How the numbers work
Image bit depth
Link between pixels and file size
'Pixels' and 'Dots'
To represent a picture, lots of dots get put side by side representing both height and breadth. We then measure how many of them cover an area we usually measure them per inch. So you might have heard of 'dots per inch (dpi)' and 'pixels per inch (ppi)'. You may even have heard the terms 'lines per inch (lpi) and 'samples per inch (spi)'. All of these come from different parts of the imaging or publishing industry and all refer to the different ways of using lots of dots, each of a single colour, to represent an image. Let's look at a few of these:
Printer dots
Printers use dots to render images. The dots are made up of different spots of ink that may vary in size and frequency.
Inkjet printer dots
FIGURE 1 Ink jet printer dots are all uniform in size, but they vary in the spacing between the dots to make colours in the image appear to be darker or lighter.
Inkjet printers have to convert the pixels into dots made up of the four basic printing colours of Cyan, Magenta, Yellow and Key (black). As a consequence, people working in the printing industry will usually refer to the images being made of 'dots' rather than 'pixels'. Mixing these dots gives the impression of continuous colour tones when viewed at the intended viewing distance. The dots are usually the same size, so lighter colours are created by moving the dots further apart so that more white paper is shown, and darker colours are made by printing the dots closer together, to the point where no white paper is showing. Some better quality inkjets now use more than the four bacic printer colours to give a richer range of tones.
Commercial printing dots
FIGURE 2 Commercial printers have equally spaced dots but actually vary their size to render darker or lighter colours in the image.
Commercial printing, such as Litho or Web, also coverts pixels into dots. Unlike inkjet printers though, these dots are evenly spread apart with each basic printing colour printed at a different angle. Smaller dots allow more white paper to show, so making the tones lighter, and larger dots that can increase in size to the point that they overlap will make darker colours. However, people working in the print industry will usually refer to these as 'lines' for historical reasons, as originally the dots were created by projecting photographs through plates of glass with fine lines etched into the glass that made the dot patterns.
The reason for having a different colour system when printing is dealt with later. Although it is not normally the job of the photographer to convert images into the standard printer colours (this should be dealt with by a person who has the links to the printer operator, usually the designer), it is still important to know some of the basics so that you can check that you are supplying healthy images that don't cause colour problems further down the production line. See the page on Why printing is 'CMYK' if you would like to know why there is a different set of colours for printing.
Digital dots
Digital images are also made up of dots of solid colour. These are called 'pixels' and fit together side by side with no spaces in between. These vary according to the device they are displayed on.
FIGURE 3 Although not usually visible to the eye, an image is made up of many tiny pixels, each of a single colour, that are so small your eye sees them as continuous tone.
Normally we view images as continuous tones, unaware of the structure underneath. But when an image is digitised it is broken up into tiny blocks with a description of the colour value at each point.
FIGURE 4 In this exaggerated example we can actually see the pixels.
Above the image has been converted into many rows of solid tones; a bit like coloured building blocks. However, these image blocks change at the different stages of image production.
Camera raw digital dots
FIGURE 5 A Camera Raw file also captures pixels, although it does so in a different way to a normal digital image.
If you are capturing an image in a Camera Raw format on your digital camera, the image is in such a way that each square, or pixel, is a recording of just one of the three prime colours of Red, Green and Blue (RGB).
Normal digital dots
FIGURE 6 A normal digital file varies the colour and tone of each pixel.
This varies again when images are converted from a camera raw file, or scanned from film, then the digitised image is made up of coloured blocks. Photographers refer to these blocks as 'pixels', which is a simplification of the term 'picture element'. However, scanner operators will often refer to them as 'samples' instead, as each block is a point of colour that the scanner machine has sampled in fine rows across the image.
Screen digital dots
FIGURE 7 A monitor represents each pixel as three strips and varies the intensity of each strip to render what looks like a particular colour.
When an image is viewed on a screen, be it a computer, a television, or projection onto a wall, the screen itself is made up of pixels. These are not solid colours but are each made up of three strips of Red, Green and Blue. The image being viewed is still made of solid blocks of coloured pixels, but you are viewing them as tiny coloured stripes. The screen varies the intensity of these stripes to give the impression that they are each one solid colour when viewed at the normal viewing distance.
How will we refer to the measure of pixels over area?
In this course we are simply going to refer to 'dots per inch' (dpi). It has become the convention to refer to dpi amoung photographers, even though strictly speaking 'pixels per inch' (ppi) is more correct when referring to digital dots, which is mainly what photographers deal with. More about this later.
What pixels contain
When it comes to digital dots, or pixels, there is actually nothing in it except a series of numbers or digits, hence the term 'digital'.
FIGURE 8 A pixel is nothing but three sets of numbers that together represent a particular colour.
These numbers dictate the colour values seen. There is nothing in the pixel to say what size it should be, how far apart they are, or what the image resolution is. You do not see these digits, just the colour that they represent, although Photoshop can show you what the numbers are in some of its panels. It is the skill of manipulating these digits that is the basis of working with images. It is therefore important that the basics for these numbers are explained as there will be times when the number values will need to be checked to make sure that the colours are realistic and that they will not cause a problem later on in the production line.
FIGURE 9 At its simplest form a pixel could be black, represented by the number '0' and white, represented by the number '1'
To help explain how the numbers in the pixels work it is useful to start with an image in its simplest form. That is a Black & White image where each pixel has a value of '0' for black or '1' for white. This is known as a 'bitmap' image as it only requires one bit of information, 0 or 1, to describe the colour. The problem with this though is that there can only be two tones: black and white, which from a photographic point of view is not very useful as can be seen in the example.
FIGURE 10 An image made up of just black and white tones
NOTE: In computer terminology 'Black & White' means quite literally that, just Black and White tones with no Grey. However, a photographer thinks of Black & White as a continuous tone of black through all the greys to white. In digital terms that is referred to as Grayscale instead. There is no problem with a photographer continuing to use the term 'Black & White' in its traditional sense, but do be aware that Photoshop uses the term differently. If you are supplying images to someone else, such as a designer or picture editor, then it is safer to refer to Black and White images as Greyscales instead. They should know the photographer terminology, but it is best to be safe so as to avoid misunderstandings.
FIGURE 11 A greyscale picture is made up of many more tones than a simple Black & White image
To have a photograph with a full range of greys, as can be seen in the next example, requires a lot more the two tones provided by numbers 0 and 1. A system of 256 tones with values 0-255 is used. Again '0' represents black but this time '255' represents white. Those numbers inbetween are for all the intermediate greys between black and white.
FIGURE 12 An image with 256 tones of grey is enough to convey a sense of a continuous tone.
At first it seems confusing to say that there are 256 tones when the numbers only go up to 255. The explanation is that the range also includes '0' which accounts for the extra tone taking the total to 256. A tonal value of 0 is still a tone.
How the numbers work
Although we think of numbers in decimal terms (ones, tens, hundreds, etc) the computer does not. It uses a 'binary' form of numbers (ones, twos, fours, eights, etc) made up entirely of the digits '0' and '1'. With decimal figures it only requires three digits to write the highest value of '255', but using binary figures of just '0' and '1' it takes a total of eight digits. This means that each greyscale pixel has a number from '00000000' for black, to '11111111' for white, as the binary value of '11111111' is equal to the decimal value of '255'.
FIGURE 13 How a computer sees the numbers 0 to 255.
It is not necessary to know how Binary Numbers work. Even though all computer operations are carried out using the binary system every time Photoshop, or any other computer program, displays numbers for you to read they will always be in the decimal format so no translation will be required. What is useful to know is that as the computer needs one 'bit' of information to store each binary digit, it results in the computer having to use 8 bits of information to store the 256 possible tones from 0-255. Hence the term '8 bit' image. In computer terms '8 bits' equals '1 byte', so as a result each pixel in a greyscale image equals 1 byte in file size.
FIGURE 14 A greyscale image only has 1 set of numbers per pixel, an RGB image has three sets of numbers per pixel and a CMYK image has four sets of numbers per pixel
So far we have only looked at greyscale images. Photoshop can use several methods to represent colour, but the two that you are most likely to use are the standard set of Red, Green, Blue (commonly refered to as 'RGB'), and the printer set of colours of Cyan, Magenta, Yellow, Black (commonly refered to as "CMYK"). Why there should be different ways to represent colour will not be explained at this stage as it will be dealt with in the sections on colour. In short, all your images that you will work with and send to clients will either be greyscale, RGB or CMYK.
With an RGB colour image each pixel is made up of three numbers to represent the Red, Green and Blue values. As each RGB pixel has three sets of 8-bit binary numbers it therefore has 24 bits of computer information in total. Hence the term '24-bit colour'. And as 8 bits equals 1 byte, each RGB pixel therefore equals 3 bytes in file size. The CMYK colour image works the same way, but instead has four sets of 8-bit binary numbers and so each pixel equals 4 bytes. The result is that an RGB image is three times bigger in file size than a Greyscale and a CMYK image four times bigger, assuming of course that the images have the same number of pixels.
NOTE: In Photoshop the separate primary colours, whether Grey, RGB or CMYK, are known as “channels”. Therefore a Grayscale has 1 channel, RGB has 3 channels, and CMYK has 4 channels. Sometimes there can be confusion in describing image sizes. An RGB image is often referred to as either “8 bit” or “24 bit” without saying what the “8” and “24” refer to. Both descriptions are correct in that an RGB image has 8 bits of information per channel, or 24 bits in total (three channels). The same holds for CMYK except it is referred to as “8 bit” per channel or “32 bit” in total (four channels).
Image bit depth
Better quality scanning machines and digital cameras can use more than 8 bits with 10 bit, 12 bit, 14 bit, and sometimes 16 bit channel images being created. The number of channels for Grayscale, RGB and CMYK remain the same, but the number of digits in each channel increases. Using up to 16 bits per channel gives a huge increase in the number of colours created, not double the number as the difference between '8' and '16' might at first imply. An 8 bit image has 256 tones per channel, but a 16 bit image has 2 multiplied by itself 16 times, which equals 65,536 tones. In an RGB image this comes to 65,536 x 3 (for the three RGB channels) which comes to many trillions of potential colours.
FIGURE 15 Above is a diagram representing 8 bit, 12 bit and 16 bit images. A 16 bit image can represent trillions of different colours.
Photoshop will only accept 1 bit, 8 bit or 16 bit images, so no matter how many bits per channel the scanner or digital camera uses, if the image is more than 8 bits it will be read by Photoshop as 16 bits. No benefit is derived from this apparent bit depth increase as a 12 bit scan still only has 12 bits of information per channel, it is just that it will be stored in a 16 bit file size by Photoshop. As 16 bits have twice the number of bits of information it will result in being twice the working file size as an 8 bit image. Despite the extra file size, and the huge increase in numbers of colours, correcting a 16 bit scan in Photoshop can have some very real advantages, but this subject will be delt with under the colour section.
Link between pixels and file size
The Greyscale, RGB and CMYK images have either 1, 3 or 4 bytes per pixel (8 bits per channel images), or 2, 6 or 8 bytes per pixel (16 bits per channel images). It is therefore a simple matter of adding up the number of pixels in an image to determine the file size. For 8 bit images the Grayscale has the same number of bytes as there are pixels, the RGB has 3 times the number of bytes as pixels, and the CMYK image has 4 times. For 16 bit images the figures are twice that.
FIGURE 16 A diagram showing how file sizes vary between a true Black & White image, a greyscale image, an RGB image and a CMYK image
Unfortunatly, like most things relating to computers, there is always another variation or exception to the general rule. The term Kilobyte (Kb) could reasonably be assumed to imply a value of 1,000 bytes, but because the computer uses a binary numbering system, the decimal number of 1000 becomes a rather odd number of 1111011000 in binary terms. It was agreed by the computer industry to have this figure rounded up to the binary number of 10000000000 (2 to the power of 10, or 1 with 10 naughts). However, this is a slight increase in the number value as it then translates back into 1,024 in decimal terms. This is not a big problem, just remember that a Kilobyte is a little bigger than its name implies. So a Grayscale image of one million pixels, one million bytes, will come to only 0.95 megabytes (1,000,000/1,024/1,024), or just under 1 megabyte. The general rule of thumb of one million pixels equalling one megabyte is fine, unless you need to be exact, as the difference is small.
NOTE: See the page on number prefixes if you would like to know more about the terms used for number sizes.
To proceed from here it is best to simplify what we mean by a digital image, and only add in the variations and exceptions when nessary. For the time being, the text will now refer to all images as being colour, in RGB, with 8 bits per channel, totaling 24 bits for the three channels. You may well end up working in 16 bit (48 bit total) RGB images, but you will always need to deliver your images in an 8 bit format as that is what the clients or customers will expect, so that has become the standard.
NEXT LESSON RESOLUTION AND FILE SIZE
Up to Digital Imaging Basics
Back to Lesson Plan
On to Resolution & File Size
[转载] Image Pixels的更多相关文章
- Duiib 创建不规则窗口(转载)
方法一: 转载:http://blog.csdn.net/chenlycly/article/details/46447297 转载:http://blog.csdn.net/harvic880925 ...
- (转载)【Android】ViewGroup全面分析
转载自:http://www.cnblogs.com/lqminn/archive/2013/01/23/2866543.html 一个Viewgroup基本的继承类格式如下: import andr ...
- Android 之窗口小部件详解(三) 部分转载
原文地址:http://blog.csdn.net/iefreer/article/details/4626274. (一) 应用程序窗口小部件App Widgets 应用程序窗口小部件(Widget ...
- iOS模拟器分辨率的问题(转载)
转载地址:http://justsee.iteye.com/blog/2123545 不积跬步 无以至千里 不积小流 无以成江海 博客 微博 相册 收藏 留言 关于我 ios8/sdk ...
- OpenGl 坐标转换 (转载)
OpenGl 坐标转换 (转载) 1. OpenGL 渲染管线 OpenGL渲染管线分为两大部分,模型观测变换(ModelView Transformation)和投影变换(Projection Tr ...
- Duilib 创建不规则窗口(转载)
方法一: 转载:http://blog.csdn.net/chenlycly/article/details/46447297 转载:http://blog.csdn.net/harvic880925 ...
- 三层神经网络自编码算法推导和MATLAB实现 (转载)
转载自:http://www.cnblogs.com/tornadomeet/archive/2013/03/20/2970724.html 前言: 现在来进入sparse autoencoder的一 ...
- 【转载】iPhone屏幕尺寸、分辨率及适配
iPhone屏幕尺寸.分辨率及适配 转载http://m.blog.csdn.net/article/details?id=42174937 1.iPhone尺寸规格 iPhone 整机宽度Width ...
- (转载)Unity3d中的属性(Attributes)整理
附加: float字段检视面板修改:[Range(1,10)] 对属性进行分组:[Header("xxx")] 工具栏中调用方法,类文件需在Editor文件夹中:[MenuIte( ...
- sublime text2卸载和重新安装(转载)
很多同学使用 sublime text2 的时候,出现一些奇怪的bug,且重启无法修复. 于是,就会想到卸载 sublime text2 再重新安装. 然而,你会发现,重新安装后,这个bug任然存在, ...
随机推荐
- [EULAR文摘] 超声腱鞘炎对RA早期诊断的价值
超声腱鞘炎对RA早期诊断的价值 Sahbudin I, et al. EULAR 2015. Present ID: OP0015. 背景:为了预测早期未分化疾病发展为类风湿关节炎(RA), EULA ...
- forEach、for in 、 for of三者的区别
1.for 原始的遍历: 其实除了这三种方法以外还有一种最原始的遍历,自Javascript诞生起就一直用的 就是for循环,它用来遍历数组 var arr = [1,2,3,4] for(var i ...
- AirTest
1.环境 直接安装AirTest IDE 就可以了 2.连接手机 打开开发者模式,允许Usb调试,手机在电脑界面显示出来即可 3.Airtest辅助窗 4.Poco辅助窗 新建一个air文件 在poc ...
- js提示框触发和定时关闭
<!DOCTYPE html><meta charset="utf-8"> <script src="https://cdn.staticf ...
- 15.网关Gateway
创建网关的Module 使用注册中心和配置中心 详细可以参考另两篇篇博客-注册中心和配置中心 报错 编译报了这个错,原因是我们没有给网关配置数据库连接字符串,但是引用了common,common中有m ...
- bash 和 zsh 中while循环的方式
bash: while true; do ./a.out; done zsh: while true; do ./a.out;
- 获取小程序toast控件
Toast 含义 为了给当前视图显示一个浮动的显示块,与dialog不同它永远不会获得焦点 显示时间有限,根据用户设置的显示时间后自动消失 本身是个系统级别的控件,它归属系统settings,当一个a ...
- Android FragmentTabHost底部选项卡实现
记录一下底部选项卡的实现,很常见的代码,大神勿嘲笑. 说一下思路,在activity底部要放上FragmentTabHost放上选项,几个无所谓,每个选项卡都对应一个fragment,点击选项卡颜色改 ...
- pytest框架增加log打印(包括pytest的执行结果、自定义的log信息)
前言: 之前同事在跑脚本的时候报错了,发现没法把需要的log信息打印出来,我这边定位问题比较麻烦,所以增加了log的打印.这个问题之前已经处理过了,本来以为是小问题,结果今天又要用到这个小技巧的时候居 ...
- KMP 算法实现
# coding=utf-8 def get_next_list(findding_str): # O(m) # 求一个字符串序列每个位置的最长相等前.后缀 j = 0 # 最长相等前缀的末位 nex ...