转载自http://shutha.org/node/789

 

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的更多相关文章

  1. Duiib 创建不规则窗口(转载)

    方法一: 转载:http://blog.csdn.net/chenlycly/article/details/46447297 转载:http://blog.csdn.net/harvic880925 ...

  2. (转载)【Android】ViewGroup全面分析

    转载自:http://www.cnblogs.com/lqminn/archive/2013/01/23/2866543.html 一个Viewgroup基本的继承类格式如下: import andr ...

  3. Android 之窗口小部件详解(三)  部分转载

    原文地址:http://blog.csdn.net/iefreer/article/details/4626274. (一) 应用程序窗口小部件App Widgets 应用程序窗口小部件(Widget ...

  4. iOS模拟器分辨率的问题(转载)

    转载地址:http://justsee.iteye.com/blog/2123545   不积跬步 无以至千里 不积小流 无以成江海   博客 微博 相册 收藏 留言 关于我     ios8/sdk ...

  5. OpenGl 坐标转换 (转载)

    OpenGl 坐标转换 (转载) 1. OpenGL 渲染管线 OpenGL渲染管线分为两大部分,模型观测变换(ModelView Transformation)和投影变换(Projection Tr ...

  6. Duilib 创建不规则窗口(转载)

    方法一: 转载:http://blog.csdn.net/chenlycly/article/details/46447297 转载:http://blog.csdn.net/harvic880925 ...

  7. 三层神经网络自编码算法推导和MATLAB实现 (转载)

    转载自:http://www.cnblogs.com/tornadomeet/archive/2013/03/20/2970724.html 前言: 现在来进入sparse autoencoder的一 ...

  8. 【转载】iPhone屏幕尺寸、分辨率及适配

    iPhone屏幕尺寸.分辨率及适配 转载http://m.blog.csdn.net/article/details?id=42174937 1.iPhone尺寸规格 iPhone 整机宽度Width ...

  9. (转载)Unity3d中的属性(Attributes)整理

    附加: float字段检视面板修改:[Range(1,10)] 对属性进行分组:[Header("xxx")] 工具栏中调用方法,类文件需在Editor文件夹中:[MenuIte( ...

  10. sublime text2卸载和重新安装(转载)

    很多同学使用 sublime text2 的时候,出现一些奇怪的bug,且重启无法修复. 于是,就会想到卸载 sublime text2 再重新安装. 然而,你会发现,重新安装后,这个bug任然存在, ...

随机推荐

  1. SQL Server数据库日常检查

    1.1代码检查从昨天到现在,SQL代理Job有没有运行失败的,会把运行失败的Job名字,步骤,运行时间,错误等级,错误原因罗列出来,方便查看. ----1.1  Check Job Fail List ...

  2. http协议介绍,token和session原理

    1.http协议 https://www.cnblogs.com/lauhp/p/8979393.html 1. 定义 http Hyper Text Transfer Protocol,超文本传输协 ...

  3. JZOJ 2022.02.11【提高A组】模拟

    \(\text{Solution}\) 首先把 \(T2\) 给切了,\(T1\) 找半天规律找不到 然后打了个表算是暴力了 \(T3\) 也暴... 太暴了... \(T4\) 直接啥也不会 \(\ ...

  4. OPTIRRA研究: TNF拮抗剂维持期优化减量方案[EULAR2015_SAT0150]

    OPTIRRA研究: TNF拮抗剂维持期优化减量方案   SAT0150 OPTIMISING TREATMENT WITH TNF INHIBITORS IN RHEUMATOID ARTHRITI ...

  5. slate源码解析(二)- 基本框架与数据模型

    源码架构 首先来看下最核心的slate包下的目录: 可以看到,作为一个开源富文本库,其源码是相当之少.在第一篇文章中说过,Slate没有任何开箱即用的功能,只提供给开发者用于构建富文本所需的最基本的一 ...

  6. nodejs pm2 详解

    一.PM2是什么 pm2是可以用于生产环境的Nodejs的进程管理工具,并且它内置一个负载均衡.它不仅可以保证服务不会中断一直在线,并且提供0秒reload功能,还有其他一系列进程管理.监控功能.并且 ...

  7. Android:遍历视图

    <LinearLayout android:id="@+id/ques2_layout" android:layout_width="match_parent&qu ...

  8. 开源分布式任务调度系统就选:DolphinScheduler

    分布式任务调度这个话题是每个后端开发和大数据开发都会接触的话题.因为应用场景的广泛,所以有很多开源项目专注于解决这类问题,比如我们熟知的xxl-job. 那么今天要给大家推荐的则是另一个更为强大的开源 ...

  9. ChatGPT Java客户端,OpenAi的Java版本SDK已完成,请火速接入。

    已经支持OpenAI官方的全部api,有bug欢迎朋友们指出,互相学习. 源码地址:https://github.com/Grt1228/chatgpt-java 不对之处欢迎指正. 注意:由于这个接 ...

  10. Linux新手渣渣上路史

    Linux新手渣渣上路史 时至2022年,IT行业的迅速发展大家也有目共睹,IT行业在社会的发展中起着举足轻重的作用.其中一角Linux系统,从诞生到开源,再到现在受大众的欢迎,是一个很好的例子.Li ...