 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 most wireless. OK, 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. Come 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 voice over. 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 at right for a variety of reasons, not just because of the hard drives. But this was compelling. So like $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. And what we consciously did was both of us have about 800 gigabytes, or at least I have 800 gigabytes of files on my computer. But most of those are just stupid things like videos and music files and just single large files that added up. 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 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 boot 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 copying. That sounds much cooler than, oh, no, I can't boot 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. Disappointing multimedia election 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 don't do it just right, then it sounds really stupid. But if you do it right, then it sounds really awesome. And so it's really hard to tell right now. And this is, you're making this a really lame decision. 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 not going to say. OK, so we had some horses. They were visible, and they looked 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 scary. So this is that. OK, here we go. We'll restart this. OK. So here we have a, this is total crap. OK. OK. Now, everybody can see and hear this, I hope. OK, good. So what we have here are four horses in a flash file. 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 what an image file is then, or what a photograph is, is typically called a bitmap or a raster file. 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. You can think of it that has a bunch of rows and a bunch of columns. And each cell here 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 .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. What else? 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 and 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 bitmap 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. And you had your hand up, too? MP4. So MPG4. So there's a whole bunch of MPG standards, one of which is MPG4. 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 MPG Layer 3, 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 computer science1.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? Well, 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. 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, they'll 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 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 figured 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're going to be storing a really unreasonably large file. So in this example, if we were talking about an 8 megapixel image, so 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 that's 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 image, the end result of the image will look the same, on the hard drive it will use far fewer bytes. So GIF, for example, what they will do is try to encode, they'll 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 loss less 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 what 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 proposed, why not just say like a normal human being would, you know, 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? Okay, Germany. Anyone wanna disagree? Okay, why Germany? Dot dot dot for the blue because it changes into that 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 the end result having a smaller file type or 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 and 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 will 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've ever saved a JPEG file and you're presented with an option to choose the quality from a minimum or 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's 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, 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 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 files, 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. Okay, 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, right? 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 a lossy, lossy. So losslessly and lossy I'm hearing both. So someone with the lossy argument, why might it be lossy? Okay, okay, 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 then you send it off 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 CVS or to codacgallery.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 four by six or an eight by 10 or maybe even something larger. So even though you've made it smaller and it looks okay 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 gonna be a photograph certainly. This is really just a small dot but how would you go about shrinking a image like this that's just four pixels? Right 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 disc 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 gonna 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 wanna click and drag and zoom in on this photo. You wanna print it as an eight 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. How do you mitigate this? And this has happened to me, right? 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 wanna 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 gonna look like when you print it out at CVS or wherever? It's gonna look grainy, it's gonna look splotchy. If you've ever looked at old photographs that 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 doesn't matter if you've lossily 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? Well you could make it very small sort of wallet sized photos and show people that that's reasonable it will look okay or you gotta go back to the original you gotta 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 eight 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 five because it's five across to four because it's four 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? Yeah 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're 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 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 we'd saved over it 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 is 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 call it sophisticated word from science back in the day like entropy maybe that's a key word or what else well okay let's take a step back can we go to the ugly one describe this in a word don't say entropy abstract okay that works what else noise okay noise noise is good and another one might be random right 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 on it along these lines but one of the key features of compression uh... 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 you know what more information you're going to extract while still preserving the original content will not very much at all and entropy just refers to crazy noise uh... noisiness much like this here 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 uh... the very low entropy original image that we saw here uh... you realize that we have sort of been ignoring color up until this point so each pixel represents a specific color and so uh... this is 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 uh... 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 a really close nobody's done this i know i'm not the only one yes 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 of red a green and a blue they can make any one of the colors that we would see here all the the blue pixels in the sky or any of the uh... let's see where was that other picture all of the colors that you see in this particular image is comprised of 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 that 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 okay so let's put this another way how many values can we represent with one byte two hundred fifty six that's right so we can have two hundred fifty six different values of red two hundred fifty six different values of green two hundred fifty six different values of blue multiply that all together and you get a really big number you get something like uh... what is it sixteen million or no sixteen yeah sixteen million seven hundred thousand something something something that's how many different colors you can represent with one byte for each of these colors so you have one bite of red you have one bite of green you have one bite of blue so this means that for every single pixel we're going to have three bites of information so we have to have a bite 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 and uh... all blue but it doesn't matter we still have all of this data and so this means this is an additional property a lot of these graphics format some of these can support a lot of colors like this so if we have uh... eight bits or one bite for each of these colors that's quite a bit of data that's we can represent quite a bit of colors but instead we only had eight bits total let's say that we can only represent uh... all of these three colors with eight bits that means that we only have two hundred fifty six colors to choose from at every pixel rather than sixteen million seven hundred thousand 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 uh... column in this table is representing so jpeg for example allows for twenty four bit color so that means you divide that by three that means that each color the red green blue each have eight bits worth of color information now jiff on the other hand doesn't allow for that much color you can only have two hundred fifty six different colors uh... in every jiff file and it's 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 uh... table that says okay this color represents or this number represents this color etc etc but basically the takeaway isn't that but the takeaway is that the jiff then can only represent two hundred fifty six different colors so in combination with the compression that we talked about earlier this makes jiff an even poorer choice for a lot of images specially photographs because now we just cannot represent the complexity in color that exists in a typical photograph using a format like jiff we've talked about some some of this compression 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 uh... compressed format like jpeg we have a lossless version that's called ping that also supports all of this color they can support twenty four 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 being however 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 uh... 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 a jpeg and it's a photograph of someone that photograph might look you know something yell at 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 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 you know some kind of color behind their back up 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 format 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 through let shine through any image that's actually behind us 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 jiff file format supports transparency but unfortunately you're limited by its color depth only a bit color which means you can't really express photographs very well jpegs by contrast look beautiful no transparency support so one of the compelling features about things 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 a certain internet explorer older versions of internet explorer did not properly support transparency so you would put all this time in a making really beautiful pictures for your website that might be any shape uh... at all but you would then see inevitably a rectangle with some stupid white or black background interfering with the aesthetics but fortunately that's becoming less of an issue but i don't know your experience this yourself when you start mocking up your own web pages in just a few weeks time so any questions about graphical file formats so i can actually give an example of this so for example if we're just to look at it at a typical website like google maps for example so that 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 in image file and if we take a look we can actually see that it is this image it typically would have a white background but because of this output transparency the browser will know okay well i don't want 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 fans here it's like 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 shape as that marker and so just to round out the rest of these psd's 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 in much more useful since most people can read pdf uh... as opposed to tf tips sometimes needing different software bmp's are kind of falling into disuse the pretty retro they're pretty inefficient and even microsoft uses different file formats for the 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 uh... 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 let's go ahead and take a five-minute break alright we're back so i don't actually mean to tease with the example we will have these uh... out at the end and will hang out in the hallway if any uh... folks have individual questions and also likely post a pdf online of some sample solutions in a day or so uh... distant students as well will be getting their feedback uh... via email or uh... via u.s. postal mail and with regard to an update on the wiki and the blog and such what you'll soon have access to and will circulate an email with the instructions is just a very simple web page 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 uh... thanks to andrew sellagran one of the courses teaching fellows has written a script to sort of automatically analyze all the hundreds of posts uh... 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 f a s username on file correctly or spelled correctly so we will fix all of that uh... over email in the next few days so uh... we will address any questions you have uh... we will uh... we thought we'd just share a couple of fun ones uh... perhaps the most common answer to what happens if two computers on the internet have the same i p address apocalypse was the number one answer uh... followed by occasionally a technical answer but we enjoyed that one it kept kept things uh... lights during the several hours of grading and this one was just done right clever uh... we had this question about dan sending in email always 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 six p m my time of five hundred 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 in 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 uh... but don't worry we don't penalize for humor we appreciate it so more on that and uh... in a little bit back to reality yeah we there were some very yeah uh... and the uh... long answer question about uh... how you get online uh... there is great how sometimes a lot of people said all you have to by a coffee in schmooze the uh... the barista to find the wife by password seven it's very very clever lots of clever answers you like that so okay so back to uh... back to business now so regard with regards to some of these graphics files and bring uh... full circle this idea of having digital cameras and being able to store images on digital cameras is this idea of of of a variety of of flash memory types that can exist uh... for camp so for example this year is one of the larger examples of of flash memory that you might find for digital camera this is a compact flash card and typically what you would find uh... usually it's abbreviated as cf so sometimes if you're looking online people referring to their cf card they're referring to this compact flash card uh... that will exist for uh... for digital cameras but typically what you will find is another type of card called an sd card uh... and these are a little bit smaller and they and all these cards though are just a type of flash memory it's like uh... it's sort of like a simpler ssd uh... 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 uh... and this is actually pretty old and and i was too lazy to take out my digital camera and take out the sixteen gigabyte one just because it's i could very well have said this was sixteen but they have a whole range of very very large capacities that you can store these file types now erased but jpeg for example or whatever other file types your camera might support and typically uh... 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 the data cable was provided to your camera or what uh... a lot of people also tend to use are adaptor so this is a cf card to usb adapter for example where uh... you're just able to put in what a variety of different cards into the adapter and uh... use that just to put that that card directly into your computer and be able to download images and this is pretty useful uh... if you have just one camera for example but you have multiple memory cards and what you want to do is be be able to continue shooting so you you fill up one memory card you're able to download data to your computer and put in your your clean memory card and just continue working without having to do it without having to deal with any of that uh... without having to format it erase files etc etc now there's other types as well some so a lot of them have now luckily not been in use for uh... very much anymore sony has their own sort of proprietary one called memory stick in a variety of variations of that uh... that refer to its size so the original memory stick was actually but uh... it's very very literally the size of a stick of gum uh... and had that same sort of uh... that's the same sort of proportions of the 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 some uh... what mini sd and there's a whole bunch of much smaller types where you're able to store the same sort of information nowadays even a number of camera phones are able to have like many sd or some of these other smaller compact flash uh... memory types to be able to store your photos on 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 courses videography is staying away from proprietary stuff is probably the the only rule of thumb and that are so many stuff for years they push 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 to 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 uh... needed to get something for many sd but many sd is apparently on the way out so we actually had to get many sd but uh... 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 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 the 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 sixteen gigabytes here and when you fill up your camera you don't have to worry about sinking 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 cost twenty dollars maybe fifty dollars 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 uh... the two most popular formats are are sd and cf sd being now sort of the the most popular uh... well the variations of sd like micro sd and many sd and in fact if we were to take a look at some of the difference in size so here there's there's the three major versions sd is on the top the blue card the mini sd is below that the micro sd is below that and just to give you an idea of how big in micro sd uh... this is on a u s dine so that's how big a micro sd card is it's very very time you can easily swallow this something bad with uh... or even lose that's the first analogy that comes to mind i mean it is a serious problem it puts a whole new if it's a whole new spin on the dog ate my homework i guess if you're taking a digital camera digital photography class uh... so anyway but uh... there's even a variety of things that you can do with these so for example i take uh... bunch of photos with um... uh... with cf cards and and my computer just did not have the hard drive space to be able to uh... store all of these photos and what they have basically like external hard drives there is this is a inside of this device is a hard drive but what it has is not only usb connection but also uh... some memory uh... some flash memory connection so i can insert say a cf card and just it'll download all the images off of it i can clear the card and just be able to continue shooting and this is very very useful if you are out of the country for example and you're not and you you're not taking your laptop or you just don't have the capacity to be able to store all of your photos uh... accessories like this can really make uh... your life a lot easier but you have to weigh the difference between uh... having you know buying one of these hard drives versus the cost of just buying a whole bunch of 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 usually cost you a bit more in terms of the ink is a lot of colors 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 with which you into which you can plug a cf card or an sd card which is trying to lower the bar actually printing these things and user interface quality will certainly very 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 uh... reputations out there when it comes to media and frankly for something like media where if it breaks or is defective or some shot equality you yourself lose particular your your data your essays your photographs it's probably worth doing some due diligence anytime you're about to uh... pull the trigger with regard to stuff like this and in the space of these technologies and desk is perhaps the number one or most popular 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 would be for uh... to search for would be compact flash reviews or sd reviews reviews is a nice keyword to plug into google or the like what often and then the world of hard drives just to counterbalance on since i don't think we ever mentioned c gate is very popular as is uh... 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 in googling the name and seeing just how commonly discussed it is okay it's a good so copy of them to our beware ebay and misadvertised products and that's yet back just like hard drives not all c sr created equal if you're serious about say digital photography for example there's the one website of rob galbraith dot dot dot com uh... and what he does is he actually has a bunch of data based on some of the cf cards he'll actually speed i will uh... run speed test a lot of the cf cards to determine which of the fastest ones available for different models of cameras and different different makes of cameras and you will find this huge difference in speed so for example in writing jpegs the difference in in the fastest from the slowest this sadistic stream to cut eight gigabyte card for example can write twenty seven megabytes per second that's actually really that's pretty impressive but if you look all the way at the bottom will notice the slowest one right three megabytes per second you would know it from i find home yes the brand name well okay so that that was actually a bit of a cheat that's not actually is uh... card that's a wife i uh... doctor so that the delton pro this this one is three point eight megabytes per second so it's a big difference it is a pro but it's a pro at being slow uh... so um... quite a large difference in and like has been said you should do your research and buy from uh... from reputed companies uh... when you're purchasing these because i mean 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 you know another good site for reviews that at least we use a lot is new egg dot com any w e g g dot com personally i tend not to buy from them because i'm not a fan of the return policy they too often want to charge you restocking fees to return things i prefer amazon frankly for actually buying in uh... in some other websites but the star rating system new egg 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 can 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 okay any questions on this stuff alright so let's switch gears a little bit so we've been talking a lot about images uh... 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 three d your polygons or what what is all of this stuff mean well in order for a game uh... in order for a game to make or to render a three d space so not something that actually is three d but just something that looks three d like it there's you're looking at a room for example in your game 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 three d games how they actually accomplish what they do is through a variety of techniques so usually they build uh... a variety of polygons usually triangles uh... 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 uh... total shape in 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 this the face taking shape in this second illustration here now through a variety of techniques they might somehow smooth out uh... 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 three d polygon uh... this three d shape in memory will you get this sort of end result that will finally look like a uh... uh... a face in the end and so the reason we mentioned this is if you are a gamer you're looking at uh... graphics cards for example because you want to be able to run the very latest in games you want to get the fanciest graphics newest games then usually what you will see are ratings in terms of of triangles so some sometimes uh... 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 uh... and of course you know being a marketing term you shouldn't rely on that to to figure out which is the best or which is uh... going to be the most powerful but you'll get an idea now for what these are actually capable of and in fact uh... someone took the same sort of idea and went to a bit of an extreme by making a car in real life uh... out of a wire frame so in this case there there's a person somewhere i think this says this was in britain or maybe just in europe and in general uh... who made a wire frame car uh... and and i hear from the story that uh... even though he parked it legally on the street they still managed to give him a ticket for something or other uh... because it was taking up a space but it is actually i think sort of a neat illustration of of uh... the virtual and uh... the real world so if you actually ever watch this special features on a dvd uh... for something like avatar when it comes out or lord of the rings or anything uh... modern like uh... up or toy story these kinds of things odds are you'll see sort of uh... insights into how this stuff was made uh... technologically 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 super set of audio and really what's increasingly common these days so uh... what's compelling about mp3 is why did they first catch on so in the first place will be taken typical cd think back to our hardware lectures how much space can fit on a typical cd rom or cdr so like seven hundred megabytes so think now about a typical music cd by the store it's essentially the same technology is uh... uh... data cd that you might buy some software on so if these things hold about seven hundred megabytes let's take uh... a let's suppose that on a typical cd an artist will release ten songs so how big then is each file here so seventy megabytes so that suggests assuming that artists have for ten twenty years been filling cds with as high quality audio as possible each music file is seventy seven zero megabytes large 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 seventy megabytes a song that sounds wonderful can 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 here or wouldn't necessarily care so much about our notice if it were absent what else so it's really so maybe just to keep things at a higher level really boils down to the quality so the a nice thing about the target audience being humans were 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 heard listen to a that same orchestra on a cd or an mp3 format odds are there certainly people among us who can distinguish this but when the savings are in order of magnitude of bits ten times uh... ten times fewer bits to actually represent some song that's pretty compelling and those of you who recall uh... 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 used yourself and that alone early on helped popularize this relatively new file format known as mpeg layer three 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 there say as the seventy megabyte equivalent well there have been a more advanced codex as they're called or technologies for encoding music into different formats and as we said earlier apple happens to use something called a a c 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 many we said are used often for musical instruments uh... 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 w ma's were used for a variety of purposes sometimes uh... when you just downloaded a song from a site that happened to use microsoft technology but the 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 pit pretty and beautiful interactive but largely animated a similar in spirit to the horses dan showed before but more uh... sophisticated in that simple cartoon like uh... 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 format so and i kind of explain this implicitly before what does it mean to stream a file to your computer and contrast to downloading it it starts playing immediately are 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 in 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 you know so-called buffering as you recall the expression where it's waiting and waiting but only for a few seconds and once enough bits of 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 gonna come if you're on a bad internet connection you might get more buffering in the video might stall and so forth but if there's enough of a buffer the internet connections good enough this is usually compelling over the alternative because even today if you download a video from itunes or rent a movie from itunes uh... even though some of them will start playing automatically if you want the full thing it can take five minutes ten minutes twenty 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 twenty minutes to download the video just to start playing it now granted brawl bits spoiled because a few years ago we take at least twenty 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 then have it wait for twenty minutes to download the entire thing uh... it's frustrating at least relatively speaking so i'm i'm about to go off in a bad tangent so take over i think i think most of us are still distracted by your tivo sound so uh... all right so there's a variety of codec certain file types that can exist for uh... for videos as well and so uh... codec is is really just uh... fancy name for a compressor 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 in a via file might just be a box uh... that has within it package within it in audio file and a video file and sometimes there might be more than one and an example of this might be uh... let's say uh... if you were to look at the raw files on a on a dvd for example now dvd you might have more than just the movie and the soundtrack you might also have like the directors 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 you would you just have a very typical like video video within it and in an audio within this file uh... 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 if 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 there's something called h264 which is uh... a codec that's used usually to compress high definition video so typically when you uh... if you go out and you buy like a new fancy blu ray for example it's typically encoded in h264 now any one of these files are actually a number of these files like quicktime abi and even mpeg4 are just containers they can contain within them of video that's encoded in h264 but it doesn't have to be it can be something else as well uh... so there's an older version h263 or for example what dvds are in mpeg two not to be confused with mpeg3 this mpeg2 uh... 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 it's not the audio this is the overall video a number of these formats and there's others as well there's these are just some of the more common ones some of these can actually be within a quicktime dot movie file for example or a dot avi file and so this can actually cause some confusion if you're looking at a file and you say okay it's a it's a quick time 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 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 uh... if you have a movie file and a quicktime movie file and it has within it in mpeg2 in coded 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 is just this additional layer of abstraction so we just have a file that's named one of these things and indeed flash video dot flv file is typically encoded the video is typically encoded in h264 just as an example uh... nowadays uh... when you download an itunes hd movie that's a quicktime movie but it's encoded typically in h264 so it's 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 uh... 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 quick time link it's a really nice quality version it downloads the entire file to your computer which might be useful for what reasons right streaming isn't necessarily a given 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 not one have to deal with having to have internet access but by contrast it's again a little annoying to 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 the one if you go on any number of popular websites these days whether it's youtube or vimeo or any number of uh... 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 for format verses w m v silver light 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 not actually going to trailers dot apple dot com what i thought i'd point out to you is that you often have choices over what quality video to view and often this is the birding is put at least right now on the user i think within 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 they 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 websites kind of fun to spend waste time on because they have really high-quality movie trailers but if you click on watching uh... not much new but the arrow notice these options here so there's some numbers in parenthesis uh... next to the parentheses here that mean what like what link do i click idea i dare say that apple's website sometimes assumes too much savvy of the users uh... not really sure what i want download makes sense but what about these other and i thought might make sense if i'm on an ipod on this website 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 the subscript p notation earlier than a lot of websites but also those of you with flat screen tv's hd tv's operating a certain resolution so you may have seen the same in the markers on your tv screen when you push certain buttons or in the manual on the box when you got it uh... 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 ten eighty p 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 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 uh... ten eighty p means that there's actually one thousand eighty lines of resolution one thousand eighty 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 it's assumed men maximally because this typically does imply a certain aspect ratio even though the movies you play might not be the same dimensions what's the horizontal with nineteen twenty yes so this is nineteen twenty by ten eighty p and the world's got 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 the resolutions i 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 ten twenty four pixels by seven sixty eight so you seem to have more resolution on your tv but there's also some tv is especially smaller ones for which you really not be benefiting from that much resolution in fact things might start to look pretty small seven twenty p 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 ten eighty p but rather seven twenty p and four eighty p is even further down and you have a roughly though it can vary based on the aspect ratio eight hundred fifty four pixels by four eighty so in short which one to click with what's the relevance of knowing this my new show when it comes to these links what you pick you have to know what you have if you're watching on a tv screen because if you clicked a they say the ten eighty p but your tv just happens to be seven twenty p odds are it's going to be shrunken unnecessarily and you're just downloading more bits than you need or it's going to be cut off really depends on what the software of 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're not on an ipod you have to choose from three numbered ones what's that yeah how fast you want it how much time you want to wait wallet buffers because a bigger file uh... ten eighty p is fifty eight megabytes verses seven twenty p which is only thirty eight megabytes verses four eighty p which is thirteen megabytes and that might be tempting well thirteen 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 unfortunately this is kind of a stupid decision to have to defer to the user these days uh... this is not an interesting problem for normal human to solve if you just want to watch a movie trailer but frankly that's why they simplified up there and say we'll figure it out for you uh... by automatic but certainly for the video files on this level of granularity might actually be of interest especially if you're downloading these things and saving your hard drive to watch later if it's the actual movie and not just the trailer so i would say that yet another thing that you should use when trying to figure out which uh... resolution to pick is the resolution of your own monitor so uh... just as an example i just tried downloading the ten eighty p 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 pixels 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 seven twenty p it's like twelve eighty by uh... maybe it's a little bit more it's twelve eighty by eight hundred something or something like that i think is the resolution of this screen and so when i tried to actually look at this video full size let's see uh... zoom let's see view it's not going to do it in this case i guess it's shrinking it to size for me automatically is that uh... if i were to see it at the full size of this particular video you would just extend way off the side of the screen i'm just needlessly downloading bits because i can't display any larger uh... any larger of uh... resolution anyway and even worse is that particularly older computers really struggle with ten eighty p unless you have a really fast really new very modern computer you're most likely not going to be able to look at seven twenty p or rather ten eighty p and instead you'll have to focus on one of these lesser types seven twenty p or even four eighty p so what's going to happen if you get ambitious and try to click the higher res than your cpd to do this you'll see exactly what happens here just can't keep up with the number of of pixels and i get what's what i called dropped frames so it's it's trying to play all these frames but just can't do it so the end result is this jerky motion and in fact i guess this version doesn't but typically sometimes what you would see is the frames per second that this particular video is displaying in and uh... in this case typical ten eighty p should be at about twenty four frames per second that's just a typical movie that's number of frames that you see every single second uh... in this case this computer can't keep up with it and the reason might not only be uh... the size and you can tell that the current size is much smaller than the actual resolution of ten eighty p the current size is ten twenty four by five sixty five compared to what it actually is nineteen twenty by ten eighty so it's downsizing this 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 two files essentially we have two formats one h two six four representing the uh... the video file you can see it's it's actual resolution there it's nineteen twenty by ten fifty six and the the sound file is encoded in a a c two channels which means it's sterile and also just uh... measure of of the frequency available here and in fact if we take a look at some other examples uh... so like if we just take a look at say in iphone when iphone is capable of playing now we can tear power 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 a a c which we actually talked about earlier protected a c that's uh... the proprietary format that apple has for downloading uh... at least older music files no longer i think they have the protected a c format right a variety of mp3 file formats and wave a i f f just some of the 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 each two six four so it does support the newest codec however uh... the trick with these portable devices that again ten eighty p seven twenty p these are a lot of it's a lot of data it's a lot of pixels it's usually not really necessary particularly particularly on devices that are this large or rather this small you can see it reflected in the tech in the technical specifications like what this can actually play so yes you know this can play each two six four video it can only play up to one point five megabits per second so that's the bit rate for this video and at a maximum resolution of six hundred forty by four eighty pixels so it's really sort of like uh... basically four eighty p that this is capable of of playing and there's a whole bunch of other things so you can see uh... uh... so baseline we don't care about right now a a c lc so this implies the sound file just within this particular container and we can see some of these other formats as well and for the mp4 m o v file format these are all those containers that we had mentioned uh... 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 triple a 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 uh... tevo which is a dvr digital video recorder connected to it and right now it happens to be on whatever channel is playing this uh... triple a add because what i also have connected to the tevo 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 uh... tv and your tevo or between your tv and your cable box it's not a tevo 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'd 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 happen to be my iphone at the moment has an ip address on harvard's campus or now you can do it over three g at nts network and this is literally my tv and if this didn't blow your mind this is a very underwhelming commercial would be more fun if we're an actual tv show playing but it could be i was thirty thousand 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 realized this is a geeky admission but it was the coolest thing that i was sitting there thirty thousand feet in row twenty three f watching curb your enthusiasm on hb o playing in my apartment in boston on my iphone on a moving airplane so uh... relevant only in so far as this is uh... relevant to multimedia today it's really quite cool and sadly you can now watch your tv on even the nb t a since a lot of trains out a lot of the tea stops even underground have all wireless access for the cell phone network and so at least at park street in downtown crossing certainly when you're above ground actually sit on the subway now watching my tv i don't have to pre-download the videos to this it's all streaming it's not an apple product if it's a relatively small start-up that has their own device and it's not cheap it's probably between a hundred and three hundred dollars now they have a few different models but the coolness of factor alone helped me rationalize it and frankly it's great at this is way too much time to spend on this particular time but it's wonderful if you travel a lot or if you're at work and like to slack off a lot you can actually play it on your uh... computer screen as well it's just if you're a little watch a little too much tv it really enables that and actually one of the neat things about uh... broadcast tv particularly hd is that it's just it's encoded over the air uh... in a very typical format it is actually encoded in mpeg two uh... in an mpeg two codec which means that if you have a very simple adapter like this for example this is uh... one company produces this product called an itv and you can connect it to your mac and you can connect an intent to that and you are presented with software that literally let's 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 the actual file that made up that tv show on your own computer so you can watch for example craig ferguson on your on your computer from home so uh... so i guess while he's watching curb your enthusiasm i'm over here watching uh... craig ferguson and it's actually 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 the software will for example re-encode for ipod or iphone friendly format so you can have it on your own ipod or iphone while you're out traveling for example or you can watch it uh... from afar you can even share it within rooms and it's just a really neat sort of technology that that now there's this collision between uh... computer video formats and actual broadcast formats that are used to to uh... to play these uh... these tv shows over the air and that's the funny thing even though we focus tonight on computers and laptops and such if you have comcast or verizon file as 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 the same technologies one of the same codex that they happen to use to stream those bits down to your own connection uh... and realize to 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 u s b devices connected and if you didn't notice uh... there's a little coaxial connector there's little metal prongs that you see on the wall when you plug a an antenna into the wall or cable jack that actually allows him to connect it to an antenna or to cable service uh... or file as 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 a lot of interest in tv put together for just people like us to use and play with so the irony is that the dvr's 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 uh... if you start to experience with these uh... home media centers are windows has its own product for this this is really the future where you'll just go up to a menu on your screen click a few links and then you'll be watching that show on demand this notion of tb guys and uh... and schedules is probably going to be behind us before long this really is the ultimate expression of of multi media when you can have these files on your computer and just and you can and there'll be programs that will organize them very nicely make it very pretty for you don't no longer at least in the future hopefully will we not have to go to a video store even have to rely on on red box 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 will be future looks bright can i make one other product endorsement okay said the coolest thing other than all the other cool things we've gotten over the past couple of years is if you are music aficionado and you have uh... increasing uh... 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 uh... 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 speaker 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 uh... desktop computer open up itunes and from a little drop-down 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 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 there's very much this convergence between real life in what was once perhaps more arcane on your desktop and laptop see you next week