All right. Welcome back to Computer Science E1. Tonight is all about multimedia, which is the use of videos and graphics and sounds and such. And so by the end of tonight, you should have a much better sense technically and even as a consumer as to what all these various acronyms are, what all these various file formats are, and what you can do with each of them. But before we do that, we thought we would relate a little tale from our recent real lives. Dan and I have this mutually beneficial or mutually expensive habit of whatever one of us has the other must have. And so literally this past week, both of us bought what's called an SSD, a solid state drive. We talked about these recall a couple of weeks ago. And our motivation was this. We both happen to have desktop computers. They happen to be Mac Pros, which are desktop tower computers, but made by Apple. And they're both pretty souped up already. They've got two processors, each of which has multiple cores. We have gigabytes worth of RAM. So far as upgrading goes, there really wasn't all that much room for improvement until Dan, unfortunately, started googling and got me thinking. So the slowest device in our computers, arguably at this point, a week ago, were the hard drives. And why just instinctively might the hard drives have been the slowest component in the computer? What's interesting about hard drives that might make them slow? It's possible because it's harder to like change. It's harder to like be changed because it's the first software. OK, harder for the? Harder for them to be changed, but arguably everything else in my computer is already hardware. And it's not that easily changed either. But not a bad thought. What else? Yeah, so that's the real kicker. So the fact that the hard drive is one of the few components inside our computers that still has moving parts, next to maybe the fans, but the speed of your fans don't necessarily contribute, certainly not nearly as much, to your computer's performance. So what better way to improve the speed of our computers by removing this slow part and replacing it with something that's purely electronic? Solid state drives, recall, are like bigger flash drives that can store tens of gigabytes. And so I was mostly struck by this video. So maxsales.com happens to be a company that sells computer hardware, but they have this side-by-side comparison of supposedly identical laptops booting up one off of a solid state drive, SSD one off of a hard drive. So let's take a quick look here. Do we have audio on mine? Seems not. Yeah, I'm on. Well, what they're talking about is, can we get this going? Come on. Well, on our, I'll fake it. On our left, we have a stock MacBook Pro. And next to it is an identical one, but on the left-hand side is the hard drive that came with the particular Mac. And on the right-hand side is the one that they've upgraded with an SSD. And to be honest, we don't really need much of a voiceover, so this isn't a huge loss. Still booting. This is just macOS, the operating system that's been installed on it. Notice on the right-hand side, a couple of applications just launched by default. Essentially, they dragged Photoshop's icon or a couple of programs into the startup items folder so that it would boot the moment the computer actually booted up. And these are decent, modern computers, maybe a year or so old. And there we go. I mean, it feels deathly slow, but arguably, if you went home tonight and booted up your own laptop or your own desktop and sat there with a stopwatch, odds are it'd be closer to the one at left than to the one for a variety of reasons, not just because of the hard drives. But this was compelling. So $200 later, did my computer have a solid state drive? And it was actually a fair number of steps, but most of it was available online, or if you two have questions, just instant message Dan when you have them. And what you can do is copy. What I did was copy the contents of my hard drive onto the solid state drive and then rebooted from the solid state drive. And the OS makes this relatively easy. And the only gotcha was that the price points for solid state drives not nearly as impressive. So you can go out, as we did recently, for similar upgrade purposes and buy a 1 terabyte drive, 1 trillion bytes, or even a 2 terabyte drive for between $100 and $200, roughly. So 1 to 2 terabytes. Now, by contrast, we bought 80 gigabyte SSDs for $200. So you kind of get screwed on the dollar per megabyte price point. But if you care more about speed, that may very well be a reasonable trade-off. What we consciously did was both of us have about 800 gigabytes, or at least I have 800 gigabytes of files on my computer.  The operating system itself and the important stuff that actually empowers my computer to boot and even all of my programs only totaled about 30 gigabytes. So I copied everything except my personal documents and movies and such, the SSD, left everything else on the slower moving parts hard drive. And the net result is that we both have somewhat faster computers. Actually, that's a kind of underwhelming way to leave it. We both have somewhat faster computers. But that is, in fact, the moral of the story. And the video, though, perhaps speaks more effectively than even our own personal experience. So with that said, multimedia. OK, so that's the story that he doesn't tell you is when he's copying over his user folder yesterday morning and he frantically gives me a call and I'm out doing my own thing. He's like, oh, no, I can't put my computer. But he didn't tell me at the time that his own thing is hanging off the side of a rock wall where he was climbing. That sounds much cooler than, oh, no, I can't put my computer. OK, anyway, so back to multimedia. So we have a variety of formats in multimedia, as you know. So we have sound files. There's some that you're probably familiar with, like what's a popular sound file? DotWave, OK, MP3 is sort of like the sound file that everybody's familiar with. And then we also have image files and different ways of expressing images, like photographs or even cartoons, like this. And we can even combine all of these things in sort of like one large multimedia package. And so this, as you can see, is an example of a file called a flash file. And hopefully my sound will work. My sound doesn't work either. It's going to be a really disappointing multimedia lecture. It's disappointing multimedia lecture without the sound. OK, and so what's awesome about this particular flash file is that when I click on one of these horses, they actually start to sing, as you will shortly see. No, maybe not. Now it's not our fault. No, this is definitely not our fault. OK, so this is harder to voice over. But this guy, he goes, no, it's not. You can do this. No, he does something like, boom, boom, boom. Well, I can't sing. So whatever it is, it's something like that. And then every time you click on the next one, it's like they form this sort of round robin.  But if you do it right, then it sounds really awesome. And so it's really hard to tell right now.  Keep going with the soprano next. No, I can't do that. And so we have, in the end, something that should work really well, but doesn't at all. Can I at least have my image back so I can show some other stuff? I'm going to put you to this mic here. OK. So don't mind me. Focus on him. But now I'm going to say, OK, so we had some horses. They were visible. And they look neat. And they'll sound even better when they start playing. But another thing that was particularly neat about this type of file, oh man, this is good. So this is that. OK, here we go. We'll restart this. OK.  Now everybody can see and hear this, I hope. OK, good. So what we have here are four horses in a flash file. And when I click on one, they start to sing, like this. OK. And I can add more horses just by clicking on them. OK, so let's see. OK, so now we can get this sort of nice thing going with all of these horses. I missed that one, but whatever. OK, but one of the neat things about this that I want to point out isn't the fact that they will sing us very nice harmony. But one of the aspects of this particular file is that we can actually change its resolution. And one of the things that you'll notice is that no matter how small or no matter how large it is, it still looks sharp. Like normally, when you take an image and you make it bigger and you make it bigger and you make it bigger, what happens to it? Yeah, it's grades. It becomes something that's called pixelated. So there must be something going on here that separates this particular type of file from others. In fact, in this case, in a lot of flash files, except for the video files, like you would find in YouTube and some of these other sites, have a graphics format that's known generally as a vector format. So in other words, there's different types of files. There's ones that we typically know of as being photographs. So something like this, which is just sort of a typical photograph. And a photograph is not a vector file. You can't make it larger and you can't make it infinitely larger and you will get sort of the same sharp image.  And this, if you try to zoom in on one of these, so this is just zoomed in from a very small dot up there, is that you can see each of the individual pixels that make up an image. And so a typical photograph is going to be this format. This is typically what you would see whenever you download a photo or whenever you are looking at a picture online. It's just a two-dimensional array, basically, of all of these pixels. It's just a big table.  And each cell here makes up, has a particular color. And each of these colors, in combination, when you view them at a distance, will make the overall image that we see here. Now, vector, though, this was designed for an entirely different purpose. This was so that you could just make using mathematical formulas instead of just defining, say, a table. You could define, say, a circle very easily using a mathematical formula. And then the computer would know, OK, if I'm zooming in on this circle, zooming in and zooming in and zooming in, then I would know that even if I zoom in on this very tiny portion here, that it will still look like a portion of that circle that I'm viewing there. So there's a variety of ways that we can make these same sort of bitmap images. So vectors, that's a little bit more difficult. You can't go out. You can't use a digital camera, for example, to be able to take a vector image. Usually this is something where you require a fancy program that's able to, where you are able to define each of the vectors and you are able to define each of the shapes that will, in combination, make up a vector file. Now, but photos are typically made through digital cameras. And this is something that you're probably a lot more familiar with. And it's very close, the relationship, a one-to-one relationship between the sensor in the digital camera, what actually captures the light and what actually creates the image and the end result that we have here. So in a digital camera, we have something that looks very similar to this. It's just on a very, very small scale. It's just an array. It just has a bunch of rows and columns that are pixels. And in combination, when they capture the light, they're able to make, then, the final image, the final digital photograph from this particular camera. And in fact, as an aside, these things called pixels. You can see them if you have a flat screen TV. How many people have flat screen TVs these days? So if you walk up close tonight, perhaps with no one looking, and put your eyes literally like an inch or so from the screen, when you're up that close, if the TV is big enough, odds are you can start to see this pixelation. Everything will look quite blotchy. And that's because what you're seeing are many, many, many little squares that compose that picture. So multimedia, more so perhaps than some of the domains we've looked at yet, have so many different file formats. And just in layman's term, what do we mean by file format? How would you describe this to a friend? What's a file format? No, it's saved. OK, so how it's saved, right? So Microsoft has a file format for documents. It's called the doc format, or the Microsoft Word format. Excel has a file format for spreadsheets. And there's all sorts of different file formats. And what that means is that the bits that compose that file are just laid out in a certain pattern, a pattern that Microsoft mandated looked like this. Well, in the world of multimedia, there's so many different formats because this world, perhaps more so than a lot of domains, is constantly changing and arguably getting even better. And this has been popularized by things like MP3s, as you may know, and iPods, because all of us, probably in our pockets right now, have some kinds of multimedia on their cell phone or on your desk right now in the form of laptops. So just so we have kind of a lay of the land and can pick and choose as we proceed tonight what to focus on, can you recall the names or acronyms for any particular file formats for graphics? OK, so PSD, which stands for Photoshop Document, Photoshop being a very popular commercial program for making graphics. So dot PSD tends to be the convention. I heard a couple others. JPEG. So JPEG is used for what in a word? Pictures, photographs, typically. And we'll come back to that in a bit. GIF, OK? And technically, that's what I once called it to. But after some Googling and some Wikipedia, the founders call it GIF. So I've acclimated to that. Oh, you said TIFF. Oh, then there's also something called GIF, which is pronounced GIF. And TIFF, yes, is used for what format? Or for what purpose, rather? Anyone know? Imaging? OK, imaging, yes. So scanning. So often, if you want some high-quality copy of an image you've scanned, or if you work in the desktop publishing business and do advertising work, this kind of stuff, TIFF, as we may revisit, is higher precision, higher fidelity than a lot of these file formats. Other things come to mind for graphics, specifically? What's that? BMP. Yeah, so BMP, any of you who have a PC at least a few years ago with Windows 95, 98, and XP might have booted up your computer for the first time and seen those rolling hills in the beautiful blue sky, well, that was just a graphic in BMP format. And this word actually perfectly describes what Dan alluded to there pictorially. A bit map is just a map, something that goes left to right, top to bottom of something, in this case, pixels, little dots. So in fact, if you look up real close to that computer screen, you might very well be able to see those bits or those pixels as well. All right, so besides graphical file formats, what about video file formats, which are increasingly common these days thanks to YouTube and the like? MOV for QuickTime. So MOV happens to be the file extension. But this is otherwise known as QuickTime, something from Apple. If you download movie previews from Apple, trailers, these kinds of things, they're very often, but not always in QuickTime format. What else? AVI. AVI. So another file format for video is AVI. If you ever have edited videos or imported them from a camera years ago, odds are it would be ripped in this format, though yet others are possible these days. Other file formats for videos? Yeah. OK, WMA is actually for audio. MV. So WMV for video is Microsoft technology for video.  MP4. So MPEG4. So there's a whole bunch of MPEG standards, one of which is MPEG4. Many of you, most of you probably know of its predecessor, even though it was really an audio format. And even that's a bit of a white lie. MP3 is a file format for audio. And technically, it's MPEG layer three, but never mind the numeric distinction. Unless we be going a bit fast for these right now, realize we'll come back and tease some of these apart. The goal is just to toss it all out there and figure out what we'll focus on. Anything else for video formats? Who's visited YouTube before? So what are the file formats used there by default? Yeah, so Flash is a technology that Dan just showed us in the form of these horses. And even though they happen to be animation cartoon-like, Flash can also be used for video content. And if you've actually watched videos at Computerscience1.tv and streamed them, so to speak, where you're not downloading a whole movie file and waiting 20 minutes for it to download, but you start watching after just a few seconds, you're streaming a file format in what's called Flash. All right, and just to round out the discussion, before we turn things back over to Dan, what about audio? We already mentioned MP3, someone with iTunes. What does iTunes rip music by default in? And by rip, I mean copy from a CD to your hard drive. AAC. So it's a newer, purportedly higher quality encoding format. But we'll come back to what we mean by higher quality in the context of these things. Other formats? WM-A is one from Microsoft. Others? Yep, Wavefile. So Wavefiles are kind of fun and retro. It's what audio files were generally encoded as very early on. It's not nearly as high quality if this is true. Well, not so. It can be really high quality, but really quite huge. And so that was inevitably the trade-off back then. Other formats, yeah? AUP. AUP, yeah, this does exist. I'm not as familiar with it. So I'll just fess up right now. We won't be focusing on this one tonight. And any others to round out the chart here? Any others? I'm going to toss one out there if there are any musicians in the class. MIDI? M-I-D-I. So if you've ever worked with a digital keyboard, electronic keyboard, that's connected to a computer or some kind of digital sheet music, very likely is the music encoded in what's called MIDI format. Essentially, the musical notes are what are encoded as bits on some file. All right. What would you like to pluck off first? OK, so we'll go back to images, because that's what we were talking about before. So what David has done now has made a bit more concrete some of the different file types that can actually exist. So before, I was talking pretty generally about what an image might be, but now, luckily, we can talk a little bit more concretely about what it is. And so each of these files will end up representing the same thing. So all of these file formats listed here are actually these raster type images or the bitmap type image, where it's essentially going to store in some way a series of rows and columns that, in the end, will make up a rectangular image. And it's important to note that all of these though have different encoding schemes. So in other words, they're stored or they're written onto the hard drive in a different way. So all of these files could, in the end, represent the same image. So this one picture on the projector, for example, could be represented by any one of these formats that are here. But the difference will be what software can read these formats and how big they will be on the computer's hard drive. I mean, there's, I guess, also another difference in that some of these, and it's a little bit of a white line because some of these will actually render the quality a little bit worse in this particular photo than a lot of the other ones. And so what do I mean by that? Well, let's take a look at the comparison between some of these. So there's just a couple of file types up here. And one of them that's not on this list until now called Ping. So some of the most popular types that you will see, especially on the internet, are JPEG, GIF, and Ping. And EPS, it's not really all that popular, but it's just listed up here for, as an example, vector file type. But there's what? You just need a random vector file format? I did. There's not very many out there, so I figure, well, we're talking about it might as well throw at least one up there. So you notice that we've already discussed what this second column is. So we're going to be talking about what some of these extensions are, what some of these file types are, Ping, JPEG, and GIF. We've talked about the types, so all of these are mostly raster formats, and the ones listed on the board are all raster formats. But we haven't talked yet about some of the compression. So this is where all of these file formats will actually differ in a very, very big way. So some of them, like Bitmap, for example, is actually not compressed at all. So that means that on the hard drive itself, the raw ones and zeros, the raw bits, represent each individual pixel. So if you have a file that looks like this, that's 1, 2, 3, 4, 5 pixels, wide by 4 pixels down, then you're going to need about 20 bytes in order to represent this image on a computer screen. And that's fine if we're only talking about an image that's this big, but if we're talking about an image from a digital camera. So these days, digital cameras have measurements in megapixels, which means how many pixels they're actually able to capture. And you typically see, what, like 8 megapixels, 10. Some of them even have ridiculous numbers, like 16, 32 megapixels. That means that it is 8 million megapixels, or 16 million megapixels, 32 million megapixels. And when you think about it in terms of this, that means we have a lot of pixels to deal with horizontally and vertically. And so when we're storing this data on the hard drive, if we were to use, say, the Bitmap file format, which is uncompressed, then we are going to be storing a really unreasonably large file. So in this example, if we were talking about an 8 megapixel image, that there's 8 million pixels, how many megabytes or bytes or kilobytes would we need in a Bitmap to store that one image? Approximately. Yes. It does depend on how many bytes per pixel, but if we just go the easy route and say one byte for every pixel, yeah, so it's going to be about 8 megabytes. And in the context of all of these other multimedia types, that's really very large. So a typical MP3 file might not be that large. So an entire song that's three or four minutes long might only be maybe three megabytes or four megabytes, just as an example. And so representing one image in Bitmap that's uncompressed is not going to be a very efficient way of doing this. So that's where a lot of these other formats have come in. So most of the other ones are compressed, which means that even though the end result of the image will look the same, on the hard drive it will use far fewer bytes. So Jiff, for example, what they will do is try to figure out what colors are the same in a particular row, just as an example. And then it will compress all of that down just to make it easier to write to the hard drive and easier in terms of the size of the file. So we can very easily make then a file that's much smaller than some of these other ones. But there's an important distinction when we're talking about compression for just about every file type. And this applies to more than just images. This can apply to video and also to audio as well, that there's two types of compression generally. There's a lossy type and a lossless type. And so if we have, say, a lossy compression type, that means that while we're compressing this data, while we're making it smaller to store on the hard drive, we're throwing away some bits. We're going to be making some assumptions about what this should look like, what the end result will be, and the end quality will not be exactly the same in a lossy compressed file than the original file. And we'll show some examples of this in just a little bit. But by contrast, lossless compression means that it's making the file smaller, but it's ensuring that it's exactly the same in the end as the original file, as the original image or as the original sound file. Lossless means that it can be an exact replica once you've decompressed it, once you've taken that compression, and once you've removed that compression and gotten the original file back, it is the original file. So I propose, if you can toggle over to the screen, that these two national flags, one of Germany, one of France, can both be compressed pretty effectively. So just intuitively, why might this be the case? Why, if these are represented as grids of pixels, as Dan's drawn on the board, can you likely compress these somehow? Use fewer bits than one per every pixel. Yeah. Good, so a lot of these pixels, as best we can tell from the colors, are exactly the same. And according to this diagram of pixels, where a graphic is just a grid of pixels to the left, from the right, and then from the top to the bottom, well, the naive way of representing an image, which is pretty much with this guy, bitmap does, is says, from top to bottom left to right, this pixel is black. This pixel is black. This pixel is black. This pixel is black. Dot, dot, dot. Next row. This pixel is black. This pixel is black. This pixel is black. Dot, dot, dot. Next row. Then finally, you get to the reds. And finally, the story changes. This pixel is red. This pixel is red. I mean, it's very quickly becomes tedious, but more so, very redundant. So as you've proposed, why not just say like a normal human being would, the top third of it is black. The next third of it is red. The next third of it is yellow. And that's precisely what a format like GIF does. Instead of representing every single dot with a specific byte, sized value, or two bytes, or three bytes, it summarizes the data. And it might say that the top left pixel is black. And you know what, so are the 100 pixels to the right of it. And next row, same thing. Next row, same thing. And then it does get interesting when you hit the red, but at least then you can start summarizing as well. So to be clear, GIF works in this left-to-right fashion and kind of waves its hand at the rest of the row if it can summarize it succinctly. So with that basic definition, which flag, Germany on the left or France on the right, can be compressed more? OK, Germany. Anyone want to disagree? OK, why Germany? Because it changes the internet, but white halfway through. Good, exactly. So with the French flag here, you can still wave your hand at a bunch of the pixels, but only a third as many per row. I can start my story with first pixels blue, then blue, then blue, then blue. And I can say, so are the next 10. But then I have to catch myself and be like, oh wait, here comes a white one and then another 10 white. Oh wait, here comes a red one and another 10 red. I've just tripled the number of sentences I need to utter to describe that particular row. And sure enough, I went ahead and downloaded these flags as GIFs and took a look at them in my desktop here. And notice in my GIF folder here, the DE is the Germany and the FR is France. So to the right-hand side here, which one's smaller? Indeed, the Germany flag is smaller because we can use fewer bits to represent it. So to be clear, that's all that compression is about. It's about representing generally the exact same information, but more succinctly, using fewer bits to express the same information. And so based on Dan's quick definition a moment ago, is the technology that GIF uses to compress graphics in this way, what we would call lossy information is lost or lossless. There's no fundamental loss of information. So lossless, you're not sacrificing quality. This image is not getting blurry just because I'm waving my hand at the color of the pixels in the rest of the row because by the summary I've given, I can still recover 100% of the original information. I'm just expressing it more succinctly. So this is in contrast to another image file type that's extremely popular online. The JPEG file type is actually a lossy compression technique. And so this gives us a fringe benefit of being able to compress an image to a much smaller degree, or rather to compress it to a much greater degree, to at the end result having a smaller file than we would through a lossless image. And this comes through just the nature of an image versus, say, a flag. So the difference, or besides the contents, what's sort of the fundamental difference between this image that's up here versus the flags that we saw before? Yeah, it's much more complex. There's a lot more variety in color, in pixels, in everything. It's just a much more complicated image. And so when we're talking about photographs, it's unreasonable to be able to apply this same GIF compression to a photograph, because it's just not going to compress as well. Adjacent pixels on a JPEG image aren't likely to be exactly the same. And to make it more general, adjacent pixels on an image from a digital camera are not likely to be very much the same. And this is true even if you're taking a picture of, say, the blue sky. There's going to be some variation, even along a row, or even along the entire picture, of that blue color within a blue sky. So using and applying this GIF compression just is not going to work very well. So JPEG, then, is around to help us compress photographs in a much smaller fashion. But the downside is that it will be a lossy compression. And in fact, depending on the quality that you actually use in a JPEG file, you'll get different amounts of artifacts, as it's called. And in this case, so right now I took this one original image and saved it twice. So first I saved it as a JPEG file with the maximum quality. If you ever saved a JPEG file and you were presented with an option to choose the quality from a minimum or a zero all the way to a maximum or 100, it's this that it's actually telling, it's this that it's actually referring to. It's how much you're willing to sacrifice in terms of the quality in order to get a very small file. So on the left, we have a JPEG file that's representing the best quality that it possibly can. So we get a very sharp, pretty good image. But on the right, we can see what happens if we use some of the highest compression available through JPEG, or the lowest quality that's available. We've thrown out a lot of the detail. And one of the things that you'll notice is that it seems to be divided into blocks. So you might notice that there's blocks of about eight or so pixels by eight pixels that in the end make up the image. And so it's more difficult for us to describe the compression behind JPEG because it's much more mathematically complicated. And in fact, frankly, it's just I don't even know. I couldn't explain it all to begin with. But we can already see something of what's going on. It's making assumptions about an image file in entire blocks of pixels. And so if we decrease the quality in an image, we will actually lose quite a bit of quality in the resulting file. So a compression file type, or rather a lossy compression file type, is good in that we can then have a very reduced file size in the end result. But it's bad if you are not sure what you're doing, and you will get some quality issues like you see here on the right. And this is actually a very important distinction that we have to mention with regards to digital photographs. If you take a digital photograph, and most likely your digital camera is going to support JPEG, just because that's sort of the best all-around file type to choose for digital photos. Now let's say you download those JPEGs off of your camera and onto your computer. And you use some photo editor to actually manipulate them, maybe Photoshop or iPhoto or Picasso, just any one of these that can take a digital photo and manipulate it in some way. I'm going to recommend that you actually do not save that file as the same file name. In other words, the files that you download off of your digital camera because it is a lossy compressed file type, if you open that image and then you modify it in some way, maybe you add some text or maybe you adjust the color a little bit or something like that, and then you save it over the original JPEG file, then it's going to recompress that data and eventually you will degrade the quality of that image. And in fact, online there's a video I'll try to look for it in just a few minutes, but there's actually a video where somebody does this exact thing. He takes an original image and he saves it as JPEG over and over and over and over and over and over and over and over again, and it shows you in this sort of time lapse video the degradation of this file over time just as you save this image over and over and over again. So the way to combat this is as soon as you download your JPEG images off of your camera, just save a copy of them somewhere as the original JPEGs because once you resave that file in a JPEG file format, that new file is not going to have as much quality as the original. So to retain the best quality that you can, keep your originals. And then you can do whatever edits you want to copies of those originals. So there's one other way of compressing image files arguably. How else can you decrease the number of pixels used to represent the photograph you've taken? Just think very pragmatically here. OK, crop it. So literally lose the person standing next to you. So crop out other information or maybe not cropping because maybe I do actually want to keep everyone in the photo. What else can I do? So resize it. And many of you probably do this either manually or somehow automatically on your own computers when you email photographs to people. You somehow shrink the photographs. So information then, is it being lost or just losslessly compressed? If you're taking an image and then shrinking it. So lossy, lossy. So losslessly and lossy I'm hearing both. So someone with the lossy argument, why might it be lossy? OK. OK, good. So that's the catch. And you can really see or appreciate it when you actually try to enlarge that photograph again. And this is a common scenario. You take a photo. You decide to share it with some family members or friends. And so you somehow compress it by shrinking it physically. So the photograph is actually smaller to the human eye.  And that's a good thing because emails can't be terribly big. You want this thing to actually reach the recipient. But then they want to go ahead and take it to CBS or to codecgallery.com. Or they want to actually make a print of it. Well, to make a print, they might want to take what looks on their screen to be this big and actually make it a 4 by 6 or an 8 by 10 or maybe even something larger. So even though you've made it smaller and it looks OK perhaps to the human eye, you then have to take that same image and effectively stretch things out horizontally and vertically. And as soon as that happens, you start to run into this reality that everything is still a grid. So to make an extreme example of this, suppose that your photograph is terribly small to begin with. It's only four pixels total. Two on the top row, two on the bottom row. Who knows what this is. It's not going to be a photograph, certainly. This is really just a small dot. But how would you go about shrinking an image like this that's just four pixels? You can't just kind of curve things on the edge because you're limited to this grid-like approach. So what do you do? Four pixels probably becomes what if you shrink it? One, right? You really have no option. You wouldn't do something like this because then it's not a rectangle. And again, images are represented on disk as rectangles. So the only thing you can really do in this extreme case is pick one of the corners and then retain only that pixel. So suppose for argument's sake that this is red, this is white, this is blue, this is green. Well, if you want to shrink this down, we can take maybe two approaches now. We can either arbitrarily say, you know what? This resulting shrunken photograph is just going to be what color? It may be red or maybe arguably brown. Let's just mix all the colors together because that's a decent approximation of what we're looking at. So whatever the case may be, it now goes down to just red or we'll say brown. But now you want to click and drag and zoom in on this photo. You want to print it as an 8 by 10. What can you now do? Well, you can stretch this thing out so that it's four pixels again. But I apparently have no recollection now of what precise color was here, what was here, and what was here. Either I just don't know and all I know is red. So my resulting enlarged image is now entirely red, which was not my original picture. Or if I've simply kind of blended everything together as an approximation, now I have not four red pixels but four brown pixels. And though this is an extreme case, this does testify to the reality that when you compress a photo by shrinking it, by decreasing its resolution, the number of pixels horizontally by the number of pixels vertically, you do have to throw away information. At least if you're using the JPEG format and aren't just throwing away information that's redundant. In this case, we're clearly not throwing away information that's redundant because there were four unique colors there. So how do you mitigate this? And this has happened to me. I've had to answer questions from people where they've been emailed some photographs from a wedding someone went to. And for pragmatic sake, they had to shrink these photographs so that they'd fit in the email, send them off to family and friends. Then they want to go to press with them. So if you try printing a photograph that's been shrunk for the sake of transport via email, what's it going to look like when you print it out at CVS or wherever? It's going to look grainy. It's going to look splotchy. If you've ever looked at old photographs, we were just in a restaurant the other day where they had lots of flair on the wall where they had these old photographs taken of strangers. Well, they made them huge to fit the sort of style of the restaurant. They looked awful. And it's not because the people looked awful back then, but it's because they took what were probably small. And back then, not very technologically sophisticated photos and made them five times their size. Well, it's the same reality these days. Even if you try doing this, even if the photograph was taken with a $300 camera, it doesn't matter if you've lossally compressed that photo by throwing information away. So what's the ultimate recourse? Once you've lost information in the image, how can you print a really nice glossy photograph out of it? You could make it very small, sort of wallet-sized photos and show people that. That's reasonable. It will look OK. Or you've got to go back to the original. You've got to somehow educate the person who took the photograph how to get the originals off the camera, or, as Dan said, find the originals somewhere on their hard drive. So do think twice before you yourself shrink photos, unless you appreciate where the originals are being stored or if you have an actual copy. There can actually be very, very useful to shrink a photo. For example, you just want to send a copy of it to some friends via email, for example. Usually it's unreasonable to send an 8 megapixel image in an email because that's many megabytes within an email that you're then sending this one person just for an image that you think would be useful to represent in a much smaller example, just as a much smaller thumbnail. And when you're resizing images, it's also important to realize an additional term that we should mention. And that is the aspect ratio of an image. And the aspect ratio is just the ratio of the width to the height. So that means for this example, this has an aspect ratio of 5 because it's 5 across to 4 because it's 4 rows down. And so if we're going to resize this image, we want to preserve this aspect ratio. So if we want to decrease the number of pixels in width, let's say, we also want to decrease the number of pixels in height as well by a proportionate amount. Otherwise, what might happen? We'll distort it in some way. So if this is a picture of a person, for example, we'll make them appear too thin or too wide, for example, just depending on how we are stretching it. So when you were given the option to resize, it's important to maintain the aspect ratio. And usually there's different terms for this. Sometimes they say maintain proportions or keep preserve aspect ratio or something like that. But so long as you keep that option checked when you resize your image, which can be useful for a variety of reasons, then you will be able to make sure that you don't squash or squish or do anything to the people or to the contents of your picture that you don't want to. So I actually happened to find that one video that I was talking about before. So just to remind you what was going on, we had an image. And if we save that same image as a JPEG file over and over and over and over and over again, we will actually decrease the quality of it because JPEG is a lossally compressed format. So every time we save it, we're losing just a little bit of quality. And you will notice that this actually, it takes a while for this to happen. In this case, it took 600 saves in this particular file. But if you want to preserve every last piece of data that you can, then you want to make sure that you prevent this from happening by maintaining a copy of it. So we can already see that the image is degrading. It's becoming pixelated. The colors are becoming off a little bit. This is just through the nature of JPEG. And to go back to what David was talking about before, if we had saved over this original file and we'd saved over it and we'd saved over it and we'd saved over it, there's no way we can go back to the original. We've thrown out that data. That data is now gone forever. And we have this really horrible looking image from something that actually used to look pretty decent at the onset. And why might you eventually hit a plateau? So with the extreme there when the cursor was all the way to the right, at some point, you can't just conceptually whittle an arbitrary graphic down smaller and smaller and smaller and smaller while still maintaining its size and get it down to just one bit. Because that would be crazy talk. If you could take any image, compress it to just one bit, because then how would you know what bits it decompresses to in the other direction? So this image here, what strikes you about it? Why might it be increasingly hard to actually squeeze more and more bits of savings out of this image?  Maybe that's a key word. Or what else? Well, OK, let's take a step back.  Describe this in a word. Don't say entropy. Abstract. OK, that works. What else? Noise. OK, noise. Noise is good. And another one might be random. It's pretty darn random looking. It's getting all speckly, all noisily. Well, this is one of the key features. And we won't spend much more time on compression along these lines. But one of the key features of compression, one of the key aspects of an image that compression exploits is non-randomness. Case in point, the German flag, the French flag, why were we able to compress those files at all? Well, they weren't random. There was a whole lot of redundancy. But eventually, you'll reach a point like this where what more information are you going to extract while still preserving the original content will not very much at all. And entropy just refers to crazy noisiness much like this here. OK, so if we go back to this idea that we have a matrix of pixels. So we have columns of pixels. We have rows of pixels. And whose combination results in an image like this or even the very low entropy original image that we saw here, you realize that we have sort of been ignoring color up until this point. So each pixel represents a specific color. And so it would be a little bit misleading if you were to take a magnifying glass or even your face and just go really close to a monitor or a TV so you can see what a pixel would look like. And for those of you that have already done this, what does a pixel look like? So I'm looking at a block. It's a pixel. What do I see if I'm looking at it really close? Nobody's done this? I know I'm not the only one. Yeah, so we see some primary colors. So one pixel is actually divided into three so-called primary colors. It's not the same primary colors that we would have learned in elementary school, but they are typically red, green, and blue. And so between, with the combination of these three colors, a red, a green, and a blue, they can make any one of the colors that we would see here, all of the blue pixels in the sky or any of the, let's see, where was that other picture. All of the colors that you see in this particular image is comprised of a combination of red values, of green values, and blue values. And so every pixel then has three pieces of information associated with it to give that pixel color. And so the quantity of color that we have here is given by something called a bit depth or a color depth. And that defines how many bits or how many bytes we're providing to a pixel to define how much blue we have or how much green we have or how much red we have. So that means that the higher the bit depth, if we have, say, one byte of red, one byte of green, one byte of blue, then that means that we have a lot of values in each one. Because one byte means what in terms of bits? It's eight bits. And how many, so, OK, so let's put this another way. How many values can we represent with one byte? 256, that's right. So we can have 256 different values of red, 256 different values of green, 256 different values of blue, multiply that all together, and you get a really big number. You get something like, what is it, 16 million, or no, 16, yeah, 16 million, 700,000 something, something, something. That's how many different colors you can represent with one byte for each of these colors. So you would have one byte of red. You would have one byte of green. You would have one byte of blue. So this means that for every single pixel, we're going to have three bytes of information. So we have to have a byte dictating how much red there is in that pixel. It could be zero red. If it's something that's very, very blue, for example, we might have zero red, and zero green, and all blue. But it doesn't matter. We still have all of this data to fill. And so this means this is an additional property of a lot of these graphics formats. Some of these can support a lot of colors like this. So if we have eight bits or one byte for each of these colors, that's quite a bit of data. That's, we can represent quite a bit of colors. But if instead we only had eight bits total, let's say that we could only represent all of these three colors with eight bits, and that means that we only have 256 colors to choose from at every pixel, rather than 16 million, 700,000 something or other. So this means that we need a relatively high bit depth or color depth for our image to properly represent a digital photograph as well. And so that is what this color column in this table is representing. So JPEG, for example, allows for 24-bit color. So that means you divide that by three. That means that each color, the red, the green, the blue, each have eight bits worth of color information. Now JIF, on the other hand, doesn't allow for that much color. You could only have 256 different colors in every JIF file. And you can't divide it by three and say, okay, it's divided evenly like that. It works in a slightly different way. There's actually like a table that says, okay, this color represents, or this number represents this color, et cetera, et cetera. But basically the takeaway isn't that, but the takeaway is that the JIF then can only represent 256 different colors. So in combination with the compression that we talked about earlier, this makes JIF an even poorer choice for a lot of images, especially photographs, because now we just cannot represent the complexity in color that exists in a typical photograph using a format like JIF. Now, we've talked about some of this compression. And so you might see then that ping sort of seems like the best of both worlds now. Because we have now, instead of a lossy, compressed format like JPEG, we have a lossless version that's called ping that also supports all of this color. So it can support 24 bits of color, which means that we can actually represent a photograph using a ping pretty well. Now, the nice thing, that is the nice thing about ping. However, on the other hand, because it is not lossy compressed, that means that the file cannot be made as small as a JPEG file. So for the same image, the JPEG file will be smaller. The ping file will be bigger, but you will have this sort of lossless compression because of the ping. And there's this one other detail, as suggested by this alpha column, that will actually become quite relevant in a few weeks when we dive into web design. So there seems to be this gotcha right now if all of our images are necessarily rectangular. For instance, if my image is a JPEG and it's a photograph of someone, that photograph might look something like this. Well, this is fine if you don't mind seeing the background that that person's face or whatnot was actually silhouetted against. But on a web page, or really in any graphics project you might work on, sometimes it would be nice to actually put that face in front of a different screen, a different scene, so much like a green screen in TV. Or you might just want to have some kind of color behind their back, behind their head so that you have a solid white background, solid black background. In short, you want to remove this background entirely. Well, one way you can do that, and you can only do this in certain file formats, is that you can tell the file, you know what, make all of these pixels that I'm kind of shading in, casually here, make them transparent. So even though the image itself is still going to be rectangular at the end of the day, this will let shine through any image that's actually behind this. Now, why is this actually relevant? Well, very commonly on the web these days, you have many, many different images on that page. And it would be a pretty ugly world if every time we had an image on a page, it had to be one rectangle, up against another rectangle, up against another. I mean, certainly have you seen websites where images are overlaid on one another? You have curves and edges that aren't necessarily straight lines. And one of the ways in which you can do this is by leveraging transparency. So the GIF file format supports transparency, but unfortunately, you're limited by its color depth. Only 8-bit color, which means you can't really express photographs very well. JPEGs, by contrast, look beautiful, but no transparency support. So one of the compelling features about Pings for certain applications is that they too support transparency. And though this is less of an issue now, for a while, there was a problem with using them commonly on websites for at least one reason, which is that Internet Explorer, older versions of Internet Explorer, did not properly support transparency.  But fortunately, that's becoming less of an issue. But odds are, you'll experience this yourself when you start mocking up your own webpages in just a few weeks' time. So any questions about graphical file formats? Oh, so I can actually give an example of this. So for example, if we were just to look at a typical website, like Google Maps, for example, so you can imagine that there's a whole bunch of images here that are actually representing the map. And in the forefront, we have this marker, this A that's pointing down to Cambridge. And so this A actually is itself an image file. And if we take a look, we can actually see that it is this image. And it typically would have a white background, but because of this output transparency, the browser will know, okay, well, I don't want it to be a rectangle. I just want to show the marker itself. And so it can just show this marker overlay without showing a white box around this marker. And even fancier, it's subtle, but if we zoom in just a bit, what do you notice behind the red marker? There's a shadow, and that shadow is not on the map itself, because just imagine how much of a pain that would be. Google needs a custom map for every possible location where there might be a shadow. No, in fact, they're just overlaying one image transparently on another, part of which is shaded to be the same shade as that marker. And so just to round out the rest of these PSDs, these are Photoshop documents. They're more of a proprietary format, very popular with applications like Photoshop, which allows you to edit photographs and do your own designs from scratch. But that's a common file format as a result of the popularity of that application. TIFF, again, is using graphic design. Sometimes if you scan something on your own home scanner, it can or will output a TIFF file. But also common is PDF, with which most of you are probably familiar just from casual day use. That's increasingly common and much more useful since most people can read PDFs, as opposed to TIFFs sometimes needing different software. BMPs are kind of falling into disuse. They're pretty retro, they're pretty inefficient, and even Microsoft uses different file formats for their wallpapers these days. But pings are very much on the rise now that support is increasingly common. So when we come full circle in a few weeks and look at web design, odds are many of you will be playing with JPEGs, GIFs, and pings in particular. Yes, so you can... Correct, so in Photoshop, you can go to File, Save As, and save in any number of formats, all of which, frankly, on this menu appear, depending on your settings. All right, let's go ahead and take a five minute break. All right, we're back. So I don't actually mean to tease with the example. We will hand these out at the end and we'll hang out in the hallway if folks have individual questions, and we'll also likely post a PDF online of some sample solutions in a day or so. Distant students as well will be getting their feedback via email or via US postal mail. And with regard to an update on the Wiki and the blog and such, what you'll soon have access to, and we'll circle it in email with the instructions, is just a very simple webpage on the course's website where you can confirm or deny that you have, in fact, been flagged as having submitted the Wiki post and having submitted the blogs. We've, thanks to Andrew Sellergren, one of the course's teaching fellows, has written a script to sort of automatically analyze all the hundreds of posts. And you'll find, don't freak out, if we are missing something for you, odds are it's because we don't have your FAS username on file correctly or spelled correctly, so we will fix all of that over email in the next few days. So we will address any questions you have. We will, we thought we'd just share a couple of fun ones. Perhaps the most common answer to what happens if two computers on the internet have the same IP address. Apocalypse was the number one answer, followed by occasionally a technical answer, but we enjoyed that one. It kept things light during the several hours of grading. And this one was just darn right clever. We had this question about Dan sending an email, or sending an email to me. We showed you all of the email headers, and his quick note was to me, hey, my plane doesn't even leave until 6 p.m. my time, 0500 on Thursday yours, not quite out of the water yet, smiley face, Dan. And in answer to the question, even though it's not explicitly stated anywhere in the email or its headers, named two pieces of information that we could use to figure out approximately where Dan was when he sent the note. One answer was at the beach, because the not quite out of the water yet comment was interpreted a little too literally. But don't worry, we don't penalize for humor, we appreciate it. So more on that in a little bit. Back to reality. Okay, so yeah, there were some very, and the long answer question about how you get online, there is great how sometimes a lot of people said, oh, you have to buy a coffee and schmooze the barista to find the Wi-Fi password and stuff. It's very clever, lots of clever answers, we like that. So okay, so back to business now. So with regards to some of these graphics files, and bringing full circle of this idea of having digital cameras and being able to store images on digital cameras, is this idea of a variety of flash memory types that can exist for cameras? So for example, this here is one of the larger examples of flash memory that you might find for digital camera. This is a compact flash card. And typically what you would find, usually it's abbreviated as CF. So sometimes if you're looking online and people are referring to their CF card, they're referring to this compact flash card that will exist for digital cameras. But typically what you will find is another type of card called an SD card. And these are a little bit smaller. And all of these cards though are just a type of flash memory. It's sort of like a simpler SSD, but it's much, much smaller. And they usually actually have quite a few gigabytes of capacity. In this case, this wasn't an eight gigabyte compact flash card. And this is actually pretty old. And I was too lazy to take out my digital camera and take out the 16 gigabyte one just because I could very well have said this was 16, but they have a whole range of very, very large capacities that you can store these file types that now erase. But JPEG for example, or whatever other file types your camera might support. And typically in order to download the information that's found on one of these cards onto your computer, just in case it wasn't clear, they usually have a couple of options. You can connect your digital camera directly to your computer using some USB cable for example, or whatever cable, data cable was provided to your camera. Or what a lot of people also tend to use are adapters. So this is a CF card to USB adapter for example, where you're just able to put in a variety of different cards into the adapter and use that just to put that card directly into your computer and be able to download images. And this is pretty useful if you have just one camera for example, but you have multiple memory cards. And what you want to do is be able to continue shooting. So you fill up one memory card, you're able to download data to your computer and put in your clean memory card and just continue working without having to do it, without having to deal with any of that, without having to format it, erase files, et cetera, et cetera. Now there's other types as well. Some, a lot of them have now luckily not been in use for very much anymore. Sony has their own sort of proprietary one called memory stick and a variety of variations that refer to its size. So the original memory stick was actually about, it's very literally the size of a stick of gum and it had that same sort of, that's the same sort of proportions as a stick of gum, but now they're much smaller. I think they're called like memory stick duo or something like that where they're half the size of that and now there's what mini SD and there's a whole bunch of just much smaller types where you're able to store this same sort of information and nowadays even a number of camera phones are able to have like mini SD or some of these other smaller compact flash memory types to be able to store your photos on one of those types as well. And I think the takeaway for consumer and we just went through this ourselves recently getting a new digital camera with which to shoot some of the course's videography is staying away from proprietary stuff is probably the only rule of thumb and the Sony stuff for years, they pushed this technology but the reality was it was a lot easier to find the more standard non-proprietary technologies. So when it comes time to pull the trigger on your next digital camera or even camcorders, even some camcorders with which you'd shoot movies are using flash media increasingly these days, it's worth a quick Google search or an Amazon search for whatever technology the camera is advertised as using for storage just to get a sense of prices and availability. So for instance, we needed to get something for mini SD but mini SD is apparently on the way out. So we actually had to get mini SD but or rather micro SD, which is even smaller but an adapter to then make it bigger. And it was because we wanted this particular camera but these are the kinds of things that are worth being cognizant of. And if you recognize the acronym CF or compact flash SD, it's very easy to go on popular websites and do some due diligence. And as Dan mentioned, the neatest thing these days, frankly with traveling is not only how small a lot of these cameras are physically, literally put them in your pocket, which certainly has lowered the bar to my carrying a camera around and taking photographs. You can also take eight gigabytes here, another 16 gigabytes here. And when you fill up your camera, you don't have to worry about syncing with your laptop or getting the photographs off there or printing them. You can actually just take the card out, put in another card which maybe costs $20, maybe $50 depending on the technology and just go armed on your next trip with a whole bunch of these cards, as many as you feel like paying for. And just to be clear, the two most popular formats are SD and C, SD being now sort of the most popular, well the variations of SD, like micro SD and mini SD. And in fact, if we were to take a look at some of the difference in size, so here there's the three major versions. The SD is on the top, the blue card. The mini SD is below that and the micro SD is below that. And just to give you an idea of how big and micro SD, this is on a US dime. So that's how big a micro SD card is. It's very, very tiny. You could easily swallow this or something bad. Or even lose a micro SD. That's the first analogy that comes to mind. Yeah, first analogy. I mean, it is a serious problem. It puts a whole new spin on the dog ate my homework, I guess, if you're taking a digital photography class. So anyway, but there's even a variety of things that you can do with these. So for example, I take a bunch of photos with CF cards and my computer just did not have the hard drive space to be able to store all of these photos. And what they have are basically external hard drives. This is inside of this device is a hard drive, but what it has is not only USB connection, but also some memory, some flash memory connection. So I can insert say a CF card and just it'll download all of the images off of it. I can clear the card and just be able to continue shooting. This is very, very useful if you are out of the country, for example, and you're not taking your laptop or you just don't have the capacity to be able to store all of your photos. Accessories like this can really make your life a lot easier, but you have to weigh the difference between buying one of these hard drives versus the cost of just buying a whole bunch of compact flash cards. And usually, depending on the speed, getting a hard drive might be the cheaper way to go. And a lot of consumer printers too. If you go into like Best Buy or Apple these days, you can see a lot of the inkjet printers are designed to print photographs. And it usually costs you a bit more in terms of the ink because a lot of color is often necessary to go on the paper. And often you want to spend a bit more money on glossy type special photographic paper. But some of these printers now even have slots on the facades into which you can plug a CF card or an SD card, which is just trying to lower the bar to actually printing these things. And user interface quality will certainly vary, but it's worth keeping in mind. And just knowing the jargon can certainly help you navigate those waters as well. And one other thing to keep in mind, even though we haven't so much emphasized brand names in the course, there's absolutely different reputations out there when it comes to media. And frankly, for something like media where if it breaks or is defective or is of shoddy quality, you yourself lose, particularly your data, your essays, your photographs. It's probably worth doing some due diligence any time you're about to pull the trigger with regard to stuff like this. And in the space of these technologies, Sandisk is perhaps the number one or most popular or best reputed vendor. There's a bunch of others. Kensington is pretty well regarded, but doing some Google searches. Or very often, honestly, the best keywords to search for would be compact flash reviews or SD reviews. Reviews is a nice keyword to plug into Google or the like quite often. And then the world of hard drives, just a counterbalance, since I don't think we ever mentioned, Seagate is very popular, as is Western Digital. Those tend to be very well reputed. So just beware the waters when searching through various websites. When you see something dirt-cheap, it's probably worth then googling the name and seeing just how commonly discussed it is. OK, so caveat emptor, beware eBay, and misadvertised products. Yeah, in fact, just like hard drives, not all CFs are created equal. And if you're serious about, say, digital photography, for example, there's the one website, robgalbraith.com. And what he does is he actually has a bunch of data based on some of these CF cards. He'll actually run speed tests. And a lot of the CF cards that determine which are the fastest ones available for different models of cameras and different makes of cameras. And you will find this huge difference in speed. So for example, in writing JPEGs, the difference in the fastest from the slowest, this SanDisk Extreme Ducati 8-gigabyte card, for example, can write 27 megabytes per second. That's actually really, that's pretty impressive. But if we look all the way at the bottom, we'll notice that the slowest one can write 3 megabytes per second. You wouldn't know it from iFi home being the brand name. Well, OK, so that one's actually a bit of a cheat. That's not actually a card that's a Wi-Fi adapter. So the Delkin Pro, this one is 3.8 megabytes per second. So it's a big difference. What's that? It is a Pro, but it's a Pro at being slow, I guess in this particular case. So there is quite a large difference. And like has been said, you should do your research and buy from reputed companies when you're purchasing these, because you might get a rebranded one or something that you don't, or that you're paying a lot of money for, maybe misrepresented in some way. And another good site for reviews that at least we use a lot is newegg.com, n-e-w-e-g-g.com. Personally, I tend not to buy from them, because I'm not a fan of their return policy. They too often want to charge you restocking fees to return things. I prefer Amazon, frankly, for actually buying and some other websites. But the star rating system newegg has, as well as Amazon, these are nice, because these sites are so popular that they get a lot of reviews, typically for products. So even if there's some crazy people out there who complain just because they couldn't figure out how to unplug the thing or open the box, you at least get an aggregate sense of whether or not people like the stuff or hate it. So those two sites are excellent. OK, any questions on this stuff? All right, so let's switch gears a little bit. So we've been talking a lot about images. But something that we should at least mention for a little bit is that games, gaming is also a very multimedia experience. And we're not going to touch on this for too much, but you might hear some of these terms. And it seems like a good time to address some of them. So for example, wireframes or some of these 3D or polygons or what does all of this stuff mean? Well, in order for a game to make or to render a 3D space, so not something that actually is 3D, but just something that looks 3D like you're looking at a room, for example, in your game. And this is in contrast to, say, the old Mario games, which were very two-dimensional. And what I'm referring to now are these new modern 3D games. How they actually accomplish what they do is through a variety of techniques. So usually they build a variety of polygons, usually triangles, using a collection of wireframes. So for example, to build a face, we might have something that looks like this on the far left, which is just a collection of polygons whose total shape and combination will resemble a face. And so if we then shade, if we provide a color to each of these individual polygons, we can start to see the face taking shape in this second illustration here. Now through a variety of techniques, they might somehow smooth out. Or for example, they might add more polygons. They might add more triangles, for example. And by doing a method like that, they can make the face look a little bit more natural, look a little bit more smooth. And finally applying what's called textures, which are themselves just some image files that are wrapped around this sort of 3D polygon or this 3D shape in memory, will you get this sort of end result that will finally look like a face in the end. And so the reason we mention this is if you are a gamer and you're looking at graphics cards, for example, because you want to be able to run the very latest in games, and you wanna get the fanciest graphics in the newest games, then usually what you will see are ratings in terms of triangles. So sometimes a lot of these manufacturers will say, oh yeah, we can process eight trillion polygons per second or something like that. And usually they use that as some sort of measure, implying the speed of the graphics card. And of course, being a marketing term, you shouldn't rely on that to figure out which is the best or which is going to be the most powerful, but you will get an idea now for what these are actually capable of. And in fact, someone took this same sort of idea and went to a bit of an extreme by making a car in real life out of a wire frame. So in this case, there was a person somewhere, I think this was in Britain or maybe just in Europe in general, who made a wire frame car. And I hear from the story that even though he parked it legally on the street, they still managed to give him a ticket for something or other because it was taking up a space. But it is actually, I think, sort of a neat illustration of the virtual and the real world. So if you actually ever watch the special features on a DVD for something like Avatar when it comes out or Lord of the Rings or anything modern like UP or Toy Story, these kinds of things, odds are you'll see sort of insights into how this stuff was made technologically. And you'll see pictures much like this one. So audio, let's touch on this one briefly, but then segue to video because that's certainly a superset of audio and really what's increasingly common these days. So what's compelling about MP3s? Why did they first catch on so in the first place?  So like 700 megabytes. Think now about a typical music CD you'd buy at the store. It's essentially the same technology as a data CD that you might buy some software on. So if these things hold about 700 megabytes, let's suppose that on a typical CD an artist will release 10 songs, so how big then is each file here? So 70 megabytes. So that suggests, assuming that artists have for 10, 20 years been filling CDs with as high quality audio as possible, each music file is 70, 70 megabytes large. So that's actually pretty big because even Dan alluded earlier tonight that a typical MP3 these days is maybe three megabytes, four megabytes, and that's the exact same song. So how do you take something that's 70 megabytes, a song that sounds wonderful, and take it down to an MP3, which is apparently only three or four megabytes? What could you do to the file to make that happen? Okay, so compress it, certainly. And if you can now kind of borrow from the spirit of our imagery discussion, what is there to compress in an audio file? Okay, so get rid of frequencies that the human ear can't really hear or wouldn't necessarily care so much about or notice if it were absent, what else? So it's really, so maybe just to keep things at a higher level, it really boils down to the quality. So a nice thing about the target audience being humans we're not all that sophisticated a listening device. And there's a lot of range of sounds that we can't really hear or can't really distinguish. If you take an audio file and plant him in front of an orchestra and then have him or her listen to that same orchestra on a CD or an MP3 format, odds are there are certainly people among us who can distinguish this, but when the savings are in order of magnitude of bits, 10 times fewer bits to actually represent some song, that's pretty compelling. And those of you who recall when file sharing really took off in a very illegal way years ago, it was because of what piece of software? Napster. So many of you may remember this program Napster, whether or not you used it yourself. And that alone early on helped popularize this relatively new file format known as MPEG Layer 3. And it just happened to be particularly compelling because back then internet speeds weren't as fast, but they were at the point where it was pretty reasonable to download a two or three or four megabyte file. And my god, it sounds almost as good, dare say, as the 70 megabyte equivalent. Well, there have been a more advanced codecs, as they're called, or technologies for encoding music into different formats. And as we said earlier, Apple happens to use something called AAC, which gets really good compression but preserves even more quality, so that those audio files out there can really appreciate the difference. But the point is that you can throw a lot of information away and humans might not necessarily care so much, especially if it means you can download that song within seconds as opposed to minutes. Now as for these other file formats, MIDI we said are used often for musical instruments. Wave files were early on used for all of the beeps and clangs and chimes that you might hear when your computer starts up or when you empty the trash. And WMAs were used for a variety of purposes sometimes when you just downloaded a song from a site that happened to use Microsoft technology. But these same principles also apply in this world here. So one of the fascinating things about video on the web these days has been the popularization of this technology flash. For a while, this was relegated to websites that were very pretty and beautiful and interactive, but largely animated. A similar in spirit to the Horses Dan showed before, but more sophisticated than that simple cartoon-like imagery. But when video support came around and sites like YouTube really picked up on this format, people were pretty struck. Because until then, there weren't as many what we'll call streaming file formats. So and I kind of explained this implicitly before, what does it mean to stream a file to your computer in contrast to downloading it? Yeah, it starts playing immediately or almost immediately. And how might that be possible? The videos are still just as big. Exactly. So the nice thing about video files and audio files is that there's this notion of time associated with them. And most normal people want to watch a movie from start to finish. And not the opposite. Listen to a song from start to finish. And you can exploit that preference by simply sending the bits from top to bottom, left to right, or in this case, from start to finish. And just sending enough bits and so-called buffering, as you recall, the expression, where it's waiting and waiting, but only for a few seconds. And once enough bits have accumulated on the user's computer, can you just jump full steam ahead, start playing those bits? And granted, you kind of have to cross your fingers that what's going to continue to happen in the background? More bits are going to come. If you're on a bad internet connection, you might get more buffering, and the video might stall, and so forth. But if there's enough of a buffer, the internet connection is good enough, this is hugely compelling over the alternative. Because even today, if you download a video from iTunes or rent a movie from iTunes, even though some of them will start playing automatically, if you want the full thing, it can take five minutes, 10 minutes, 20 minutes. I have a Tivo at home, and there's various services like Blockbuster and Amazon Unboxed, as it's called associated with this. It's really annoying, frankly, because I'll have to wait sometimes 20 minutes to download the video just to start playing it. And now, granted, we're all a bit spoiled, because a few years ago, it would take at least 20 minutes to go to Blockbuster physically down in Porter Square. But when you sit down these days, your popcorn is already popped, and you just want to say, boop, boop, and choose the video on the screen, and then have it wait for 20 minutes to download the entire thing, it's frustrating, at least relatively speaking. So I'm about to go off in a bad tangent, so take over. I think most of us are still distracted by your Tivo sound. So there's a variety of codecs and file types that can exist for videos as well. And so codec is really just a fancy name for a compressor or decompressor. And so what's interesting, though, about each of these file types is that it doesn't necessarily, it might, but it doesn't necessarily imply a codec. And in other words, each of these file types are literally just a container. So you can think of these files as being like a box. So for example, an AVI file might just be a box that has within it, packaged within it, an audio file and a video file. And sometimes there might be more than one. And an example of this might be, let's say, if you were to look at the raw files on a DVD, for example. Now, a DVD, you might have more than just the movie and the soundtrack. You might also have the director's commentary, for example, or other languages available as well. And this sort of hints at this idea that one file can have multiple versions. So you might have the default. And this is very typical.  And then you would watch both at the same time. But there is this ability to have multiple versions of it. And this is important to realize because as soon as you start looking at a lot of these formats, you'll realize that there's codecs associated with video that aren't necessarily tied to each of these. So for example, there's something called H264, which is a codec that's used usually to compress high-definition video. So typically, if you go out and you buy a new fancy Blu-ray, for example, it's typically encoded in H264. Now, any one of these files or actually a number of these files, like QuickTime, ABI, and even MPEG4, are just containers. They can contain within them a video that's encoded in H264. But it doesn't have to be. It can be something else as well. So there's an older version, H263, or, for example, what DVDs are in, MPEG2, not to be confused with MPEG3. This MPEG2 is you just have to know it by context. When we're talking about DVDs, MPEG2 refers to the video rather than the audio file. So it's not the audio. This is the overall video. And a number of these formats, and there's others as well. These are just some of the more common ones. Some of these can actually be within a QuickTime.movie file, for example, or a .avi file. And so this can actually cause some confusion. If you're looking at a file and you say, OK, it's a QuickTime video, but for some reason I can play it in this software, but not in this other software. Even though this other software might be able to play other QuickTime movies, the problem might be this, that you're looking at the container, that it is actually a movie file. But maybe your software doesn't support the new fancy H264, for example, or maybe it doesn't support MPEG2, which is actually a common problem with QuickTime. If you have a QuickTime movie file and it has within it an MPEG2 encoded video, you can't actually open it in a typical QuickTime player, just because it does not support this MPEG2 format. So it's just this additional layer of abstraction. So we just have a file that's named one of these things. And indeed, flashvideo.flv file is typically encoded. The video is typically encoded in the H264, just as an example. Nowadays, when you download an iTunes HD movie, that's a QuickTime movie, but it's encoded typically in H264. So it's encoded with this codec. But it's just that the container file, the file that contains this video, might be any one of these file types. And the relevance? Well, if you've gone to the course's website to watch one of these videos online for several weeks, you've noticed that there's a flash link, there's flash plus slideshow sometimes, there's QuickTime, and there's also MP3. And that does assume some degree of savvy with what these file formats mean. And it turns out that QuickTime itself can be streamed. You can certainly start sending the bits and let them play online. We happen to take the approach that if you click the QuickTime link, it's a really nice quality version. It downloads the entire file to your computer, which might be useful for what reasons. Streaming isn't necessarily a given. Sorry, so you can watch it again. You don't need internet connectivity. We've certainly had folks who want to download it to go on a trip somewhere or just go on the train and not want to have to deal with having to have internet access. But by contrast, it's, again, a little annoying. You have to wait a few minutes for the video to download. And that's why the flash format is sometimes preferable. And the relevance now to sort of life beyond E1, have you gone any number of popular websites these days, whether it's YouTube or Vimeo or any number of television stations websites? You'll see sometimes links to different file formats in which you can download those videos and just understanding what it means to be in quick time format versus WMV, Silverlight is a Microsoft technology, similar in spirit to Flash for streaming video and other content. At least you'll know what links to click. And you'll get a better sense, perhaps, of what quality you'll be getting. And do you mind actually going to trailers.apple.com? What I thought I'd point out, too, is that you often have choices over what quality video to view. And often the burden is put, at least right now, on the user. I think in a few years, computers will be smart enough in general to figure out what quality should be sent along the wire. And in fact, there have been certain video technologies that can figure out what quality to send you. But if we go ahead and pick, say, the Alice in Wonderland link here. So Apple's website's kind of fun to spend waste time on because they have really high quality movie trailers. But if you click on, not watching you, but the arrow, notice these options here. So there's some numbers next to the parentheses here that mean what? What link do I click? I dare say that Apple's website sometimes assumes too much savvy of the users. I'm not really sure what I want. Download makes sense. But what about these other? An iPod might make sense if I'm on an iPod on this website. How many pixels do you resolution? How many pixels? How many resolution, in fact? So this is an increasingly common convention, not just for web video, though Apple's really pioneered using this subscript P notation earlier than a lot of websites. But also those of you with flat screen TVs, HD TVs, operate in a certain resolution. So you may have seen these same markers on your TV screen when you push certain buttons or in the manual or on the box when you got it. These are different resolutions. And what do we mean again by resolution, just to recap? Yeah, x by y. How many pixels across? By how many pixels down? So let's take one example here. 1080p means what? And p stands for progressive, which means it's a particularly good type of resolution. But this is just one number. I just know which direction here. So it's actually the vertical. So as has been the tradition in the world of television for years, you typically talk about what are called scan lines, horizontal lines. And 1080p means that there's actually 1,080 lines of resolution, 1,080 lines of pixels on your really fancy high-end TV, if you have one at home now. But how many pixels are across the x-axis? Sorry? It's assumed, maximally, because this typically does imply a certain aspect ratio, even though the movies you play might not be those same dimensions. What's the horizontal width? Yeah? 4,020. 1,920, yes. So this is 1,920 by 1080p. And the world's gotten a little annoying in that they only tell you half of the numbers these days. And to be honest, I don't always remember the resolutions. I usually do a quick Google search, and inevitably the other number pops up. But this is kind of cool, because contrast this now with your laptop screen, which very often is just 1024 pixels by 768. So you seem to have more resolution on your TV, but there's also some TVs, especially smaller ones for which you'd really not be benefiting from that much resolution. In fact, things might start to look pretty small. 720p is actually smaller resolution, but still considered HD quality. And you might get this on smaller sets, or some channels. Might not be broadcasting in 1080p, but rather 720p. And 480p is even further down. And you have roughly, though it can vary based on the aspect ratio, 854 pixels by 480. So in short, which one to click? Well, what's the relevance of knowing this minutia when it comes to these lengths? What should you pick? Why? You don't know what you have. You have to know what you have. If you're watching on a TV screen, because if you clicked, say, the 1080p, but your TV just happens to be 720p, odds are it's going to be shrunken unnecessarily, and you're just downloading more bits than you need, cut off. It really depends on what the software or the TV does. But what's really the relevance? What should govern what link you click now, assuming you don't want to download? You are not on an iPod. You have to choose from the three numbered ones. How fast do you want it? What's that? How fast do you want it? Yeah, how fast do you want it? How much time do you want to wait while it buffers? Because a bigger file, 1080p is 58 megabytes versus 720p, which is only 38 megabytes versus 480p, which is 13 megabytes. And that might be tempting. Wow, only 13 megabytes. And I can watch the trailer, but it's going to be a little smaller on your screen. And so it's just a trade-off. And you'll know best.  This is not an interesting problem for a normal human to solve if you just want to watch a movie trailer. But frankly, that's why they simplify it up there and say, we'll figure it out for you by automatic. But certainly, for the video files, this level of granularity might actually be of interest, especially if you're downloading these things and saving them. Your hard drive to watch later if it's the actual movie and not just the trailer. So I would dare say that yet another thing that you should use when trying to figure out which resolution to pick is the resolution of your own monitor. So just as an example, I just tried downloading the 1080p version. And what it doesn't show you is, and because this thing is too huge that my computer can't process it, is that the number of pixels that this video represents is actually much larger than my screen size itself. So I think my screen is actually something like, it's less than 720p. It's like 1280 by, or maybe it's a little bit more. It's 1280 by 800 something or something like that, I think is the resolution of this screen. And so when I try to actually look at this video full size, let's see, zoom, let's see, view, uh-oh. It's not going to do it in this case. I guess it's shrinking it to size for me automatically is that if I were to see it at the full size of this particular video, it would just extend way off the side of the screen. And I'm just needlessly downloading bits because I can't display any larger of a resolution anyway. And even worse is that particularly older computers really struggle with 1080p. Unless you have a really fast, really new, very modern computer, you're most likely not going to be able to look at 720p or rather 1080p. And instead you'll have to focus on one of these lesser types, 720p or even 480p. Because what's going to happen if you get ambitious and try to click the higher res than your CPU can handle? Well, if I try to do this, you'll see exactly what happens here. It just can't keep up with the number of pixels. And I get what's what are called dropped frames. So it's trying to play all of these frames, but just can't do it. So the end result is this jerky motion. And in fact, let's see, I guess this version doesn't. But typically, sometimes what you would see is the frames per second that this particular video is displaying. And in this case, the typical 1080p should be at about 24 frames per second. That's just a typical movie. That's the number of frames that you see every single second. And in this case, this computer can't keep up with it. And the reason might not only be the size. And you can tell that the current size is much smaller than the actual resolution of 1080p. The current size is 1024 by 565 compared to what it actually is, 1920 by 1080. So it's downsizing this quite a bit for me. But also the data rate, you can see that this is actually very high. It's about a megabyte of data every second that my computer has to be able to process. And in fact, we can actually see, even though this is a quick time file, we now see that within this container, we have two files, essentially. We have two formats, one H264, representing the video file. You can see it's actual resolution there. It's 1920 by 1056. And the sound file is encoded in AAC. Two channels, which means it's stereo. And then also just the measure of the frequency available here. And in fact, if we take a look at some other examples, so like if we just take a look at, say, an iPhone, what an iPhone is capable of playing, now we can tear apart what a lot of this actually means. So if we take a look at the audio playback, for example, we can see that it supports AAC, which we actually talked about earlier. Protected AAC, that's the proprietary format that Apple has for downloading at least older music files. No longer, I think, do they have the Protected AAC format. A variety of MP3 file formats and WAVE, AIFF, just some of these other file formats that we've actually seen mentioned before. And video, now there's a variety of video formats that are available as well, like H264. So it does support the newest codec. However, the trick with these portable devices is that, again, 1080p, 720p, it's a lot of data. It's a lot of pixels. And it's usually not really necessary, particularly on devices that are this large or rather this small. And you can see it reflected in the technical specifications, like what this can actually play. So yes, even though this can play H264 video, it can only play up to 1.5 megabits per second. So that's the bit rate for this video. And at a maximum resolution of 640 by 480 pixels. So it's really sort of like a basically 480p that this is capable of playing. And there's a whole bunch of other things so you can see, so baseline, we don't care about right now. AACLC, so this implies the sound file just within this particular container. And we can see some of these other formats as well. M4V, MP4, MOV file formats, these are all those containers that we had mentioned just a little while ago in reference to some of these file types. And only because it's so neat and because I think everyone should have one. I thought I would just show one quick demo here. You won't be able to see the screen very well, but I can crank up the audio. This is some TV channel in Boston playing a AAA commercial at the moment. And this TV happens to live in downtown Boston where I live. And I have a Comcast cable. I have a Tivo, which is a DVR digital video recorder connected to it. And right now it happens to be on whatever channel is playing this AAA ad because what I also have connected to the Tivo is this really neat device called a sling box, if any of you have heard of this. A sling box is a device that nicely does not have any kind of monthly subscription fee, but it's a device that you insert via certain cables in between your TV and your Tivo or between your TV and your cable box. It's not a Tivo specific thing, and then you plug a network cable into it or you get something wireless so it's on your home network. So what I literally just did when I hit on on this particular iPhone app, I could do it on my laptop as well, is I told this device sitting in my apartment in Boston to start streaming the images from my TV through my cable modem out onto the internet wherever I happened to be. My iPhone at the moment has an IP address on Harvard's campus or now you can do it over 3G, AT&T's network. And this is literally my TV. And if this didn't blow your mind, this is a very underwhelming commercial. It would be more fun if it were an actual TV show playing, but it could be. I was 30,000 feet higher once a few weeks ago than I am at the moment on Virgin Atlantic, who has really good Wi-Fi. And I, frankly, and I've realized this is a geeky admission, thought it was the coolest thing that I was sitting there, 30,000 feet in row 23F watching Curb Your Enthusiasm on HBO playing in my apartment in Boston on my iPhone on a moving airplane. So relevant only in so far as this is relevant to multimedia today. It's really quite cool. And sadly, you can now watch your TV on even the MBTA, since a lot of trains, a lot of the T-stops, even underground, have wireless access for the cell phone network. And so at least at Park Street and Downtown Crossing, certainly when you're above ground, I'm going to actually sit on the subway now watching my TV. I don't even have to pre-download the videos to this. It's all streaming. It's not an Apple product. It's a relatively small startup that has their own device. And it's not cheap. It's probably between $100 and $300 now. They have a few different models, but the coolness of factor alone helped me rationalize it. And frankly, this is way too much time to spend on this particular toy. But it's wonderful if you travel a lot, or if you're at work and like to slack off it a lot, you can actually play it on your computer screen as well. It's just if you watch a little too much TV, it really enables that. And actually, one of the neat things about broadcast TV, particularly HD, is that it's encoded over the air in a very typical format. It is actually encoded in an MPEG-2 codec, which means that if you have a very simple adapter, like this, for example, one company produces this product called an ITV, and you can connect it to your Mac, and you can connect an antenna to that, and you are presented with software that literally lets you watch TV on your Mac, and even better, it records the show on your Mac. And so you can use this, and you can actually watch TV very much in a similar way, but you can have the actual file that made up, that TV show, on your own computer. So you can watch, for example, Craig Ferguson on your computer from home. So I guess while he's watching Curb Your Enthusiasm, I'm over here watching Craig Ferguson. And it's actually a really neat thing to be able to have this on your computer, because then, now that it's on your computer, you can do a variety of things with it. So this software will, for example, re-encode for iPod or iPhone-friendly formats. You can have it on your own iPod or iPhone while you're out traveling, for example, or you can watch it from afar, or you can even share it within rooms. And it's just a really neat sort of technology that now there's this collision between computer video formats and actual broadcast formats that are used to play these TV shows over the air. And that's the funny thing, even though we've focused tonight on computers and laptops and such, if you have Comcast or Verizon FiOS and you have on-demand TV where you click a menu option and the thing starts maybe buffering for a few seconds but then playing, it's pretty much one of these same technologies, one of these same codecs that they happen to use to stream those bits down to your own connection. And realize, too, that though I personally am biased toward Tivo, Dan, because he has ITV, is biased toward that, there's a whole bunch of also free options out there. And so what Dan happens to have is, I think, a Mac Mini into which this USB device is connected. And if you didn't notice, there's a little coaxial connector. There's little metal prongs that you see on the wall when you plug an antenna into the wall or a cable jack. That actually allows him to connect it to an antenna or to cable service or FiOS service. And actually, his videos are being stored on his own personal Macintosh running software that came with this device. But there's something called Myth TV. There's a lot of open source projects, which means free software that just people with a lot of free time and a lot of interest in TV put together for just people like us to use and play with. So the irony is that the DVRs that a lot of us may have built into your cable boxes from Comcast or the like, they're really quite bad, to be honest. And if you start to experience what these home media centers are, Windows has its own product for this, and this is really the future, where you'll just go up to a menu on your screen, click a few links, and bam, you'll be watching that show on demand. This notion of TV guides and schedules is probably going to be behind us before long. This really is the ultimate expression of multimedia, when you can have these files on your computer, and there will be programs that will organize them very nicely, make it very pretty for you, and you don't no longer, or at least in the future, hopefully, will we not have to go to a video store, or even have to rely on Redbox or Netflix or any one of these video rental services, where we can just see a collection of all of the videos that exist and just be able to watch, stream it live off of the internet, and it'll be, the future looks bright. Can I make one other product endorsement? OK. So the coolest thing other than all the other cool things we've gotten over the past couple of years is if you are a music aficionado and you have an increasing volume of music on your computer, whether it's with iTunes or some other product, realize that there exist devices in the form of home routers, small ones. In fact, we have one plugged in to our desk here that Dan and I are using wirelessly to share content here, called an airport extreme. This one happens to be made by Apple. And what's really cool is if you have a home router already, connected to a cable modem or DSL modem, and so you have internet access at home, you can also get some of these less expensive home routers that just have an ethernet jack in it and an electrical socket and a blinking light. And that device connects to your existing home wireless network. But there's one other jack on these particular devices, and that's for speakers. So I happen to have a set of speakers in my living room and also in my bedroom. And so I have one of these devices in each. The speakers are plugged into them. And the neatest thing is not only can I sit down at my desktop computer, open up iTunes, and from a little dropdown menu that's actually hidden feature in iTunes, choose what room or rooms I want to pipe my music to wirelessly, you can crazy thing even do it from your iPhone or your mobile phone these days. And it's all wireless and it's all using the same exact technologies we've been talking about since week one in the course. So there's very much this convergence between real life and what was once perhaps more arcane on your desktop and laptop. See you next week.