{"video_id":"fp_av9aywNEJE","title":"TQ: How Twitter CHANGES Your Photos","channel":"Techquickie","show":"Techquickie","published_at":"2020-03-25T00:07:02.205Z","duration_s":261,"segments":[{"start_s":0.0,"end_s":4.16,"text":"Have you ever noticed that after you'd upload an image to your favorite social media site,","speaker":null,"is_sponsor":0},{"start_s":4.16,"end_s":8.64,"text":"it sometimes doesn't look quite as good as you thought it would, specifically because","speaker":null,"is_sponsor":0},{"start_s":8.64,"end_s":12.0,"text":"the image was compressed or it had its resolution lowered?","speaker":null,"is_sponsor":0},{"start_s":12.0,"end_s":16.92,"text":"Well, naturally, it turns out that there are reasons that social media services do this,","speaker":null,"is_sponsor":0},{"start_s":16.92,"end_s":22.0,"text":"as it's crucial for helping them manage the millions of images our selfie addicted society","speaker":null,"is_sponsor":0},{"start_s":22.0,"end_s":28.56,"text":"is uploading every day. So how exactly do these large services get images to us quickly, and how are they making","speaker":null,"is_sponsor":0},{"start_s":28.56,"end_s":32.96,"text":"improvements to try and keep the image quality as high as they can?","speaker":null,"is_sponsor":0},{"start_s":32.96,"end_s":37.44,"text":"To answer that, we spoke with Nolan O'Brien at Twitter, and we'd like to thank him both","speaker":null,"is_sponsor":0},{"start_s":37.44,"end_s":41.52,"text":"personally as well as Twitter itself for help with this episode.","speaker":null,"is_sponsor":0},{"start_s":41.52,"end_s":46.32,"text":"Large services like Twitter face enormous challenges trying to get images to so many","speaker":null,"is_sponsor":0},{"start_s":46.32,"end_s":52.88,"text":"different users. The images that go through Twitter's servers every day number in the billions with a B,","speaker":null,"is_sponsor":0},{"start_s":52.88,"end_s":58.4,"text":"and they have to figure out how to quickly get them to their 330 million users, even","speaker":null,"is_sponsor":0},{"start_s":58.4,"end_s":66.8,"text":"if those users are far away from Twitter's data centers. A large part of the solution is using content delivery networks, or CDNs, which are distributed","speaker":null,"is_sponsor":0},{"start_s":66.8,"end_s":74.4,"text":"storage networks that you can learn more about here. This way, devices will have a semi-nearby server to pull images from.","speaker":null,"is_sponsor":0},{"start_s":74.4,"end_s":79.76,"text":"But what about the images themselves? Well, Twitter uses both PNG and JPEG images.","speaker":null,"is_sponsor":0},{"start_s":79.76,"end_s":84.36,"text":"Both are compressed, which saves bandwidth compared to using huge uncompressed images","speaker":null,"is_sponsor":0},{"start_s":84.36,"end_s":88.84,"text":"that can easily take up around 35 megabytes if shot with a typical smartphone camera.","speaker":null,"is_sponsor":0},{"start_s":88.84,"end_s":94.28,"text":"However, PNGs use lossless compression, meaning their higher quality but take up significantly","speaker":null,"is_sponsor":0},{"start_s":94.28,"end_s":101.92,"text":"more space than a JPEG. Typically, Twitter will convert most images to JPEG if the PNG version has a high color","speaker":null,"is_sponsor":0},{"start_s":101.92,"end_s":107.44,"text":"depth, meaning that if they support 16-bit or a little over 65,000 colors, which actually","speaker":null,"is_sponsor":0},{"start_s":107.44,"end_s":112.16,"text":"isn't all that many considering modern displays support millions of colors.","speaker":null,"is_sponsor":0},{"start_s":112.16,"end_s":116.96,"text":"Additionally, JPEGs that take up more than 5 megabytes are also reduced in quality.","speaker":null,"is_sponsor":0},{"start_s":116.96,"end_s":121.56,"text":"But hold on a second, I use Twitter all the time and I think the images look pretty decent.","speaker":null,"is_sponsor":0},{"start_s":121.56,"end_s":124.6,"text":"How do they pull that off using so much compression?","speaker":null,"is_sponsor":0},{"start_s":124.6,"end_s":131.4,"text":"Keep in mind that Twitter still supports JPEGs up to about 16.7 megapixels, or about 4.2 megapixels","speaker":null,"is_sponsor":0},{"start_s":131.4,"end_s":139.84,"text":"if you're uploading from mobile. And when this service has to reduce to JPEG quality, it does so by only about 15%.","speaker":null,"is_sponsor":0},{"start_s":139.84,"end_s":144.88,"text":"Typically such a loss in quality isn't noticeable unless you're looking very closely, yet still","speaker":null,"is_sponsor":0},{"start_s":144.88,"end_s":151.76,"text":"saves a significant amount of bandwidth. And this is especially true since phone screens these days are very high resolution, yet small","speaker":null,"is_sponsor":0},{"start_s":151.76,"end_s":156.84,"text":"in size, so images can very easily be scaled down in resolution without a noticeable loss","speaker":null,"is_sponsor":0},{"start_s":156.84,"end_s":162.4,"text":"in visual fidelity. Many phone screens only have one red or blue pixel for every green, so trying to show a","speaker":null,"is_sponsor":0},{"start_s":162.48,"end_s":166.8,"text":"super high resolution photo on them would be a waste, as the phones can't even reproduce","speaker":null,"is_sponsor":0},{"start_s":166.8,"end_s":172.96,"text":"them accurately. If you compare these images to original side by side on a high-res desktop monitor, you","speaker":null,"is_sponsor":0},{"start_s":172.96,"end_s":179.08,"text":"may notice a difference. But for phone users who are often most impacted by speed constraints, the compression methods","speaker":null,"is_sponsor":0},{"start_s":179.08,"end_s":186.52,"text":"we've mentioned so far are no-brainers. Of course, sometimes noticeable trade-offs, even on mobile devices, cannot be avoided.","speaker":null,"is_sponsor":0},{"start_s":186.52,"end_s":190.96,"text":"Many people use social media services without fast connections, so if you're on a slow","speaker":null,"is_sponsor":0},{"start_s":191.16,"end_s":196.24,"text":"connection, you might notice that Twitter uses progressive JPEGs, meaning that a low-quality","speaker":null,"is_sponsor":0},{"start_s":196.24,"end_s":201.72,"text":"version will fully load first while you wait for the higher-res version, contrasting with","speaker":null,"is_sponsor":0},{"start_s":201.72,"end_s":207.32,"text":"the slowly loading image from top down as you probably remember from the dial-up era,","speaker":null,"is_sponsor":0},{"start_s":207.32,"end_s":212.28,"text":"if you're old. Then you have to factor in how people use many different devices, including some really","speaker":null,"is_sponsor":0},{"start_s":212.28,"end_s":217.12,"text":"old ones. This is a big part of the reason you might have noticed that Twitter header images often","speaker":null,"is_sponsor":0},{"start_s":217.12,"end_s":222.6,"text":"appear to be lower quality as they're capped at 500 pixels vertically to ensure that they","speaker":null,"is_sponsor":0},{"start_s":222.6,"end_s":226.68,"text":"can be shown correctly on legacy devices.","speaker":null,"is_sponsor":0},{"start_s":226.68,"end_s":230.24,"text":"But what about all the space these pictures take up on Twitter servers?","speaker":null,"is_sponsor":0},{"start_s":230.24,"end_s":235.76,"text":"Well, it turns out that storage isn't all that difficult to expand, so the choices that","speaker":null,"is_sponsor":0},{"start_s":235.76,"end_s":241.4,"text":"social networks make with how they process images has less to do with drive capacity","speaker":null,"is_sponsor":0},{"start_s":241.4,"end_s":246.84,"text":"and more to do with how to use as little bandwidth as possible for the end user.","speaker":null,"is_sponsor":0},{"start_s":247.24,"end_s":251.64,"text":"Who has an extra five seconds to wait for the next zesty Linus meme to load?","speaker":null,"is_sponsor":0},{"start_s":251.64,"end_s":257.2,"text":"Am I right? Not me. So thanks for watching, guys. If you liked this video, give it a like, give us a subscribe, and be sure to hit us","speaker":null,"is_sponsor":0},{"start_s":257.2,"end_s":261.08,"text":"up in the comments section with your suggestions for future topics that we should cover.","speaker":null,"is_sponsor":0}],"full_text":"Have you ever noticed that after you'd upload an image to your favorite social media site, it sometimes doesn't look quite as good as you thought it would, specifically because the image was compressed or it had its resolution lowered? Well, naturally, it turns out that there are reasons that social media services do this, as it's crucial for helping them manage the millions of images our selfie addicted society is uploading every day. So how exactly do these large services get images to us quickly, and how are they making improvements to try and keep the image quality as high as they can? To answer that, we spoke with Nolan O'Brien at Twitter, and we'd like to thank him both personally as well as Twitter itself for help with this episode. Large services like Twitter face enormous challenges trying to get images to so many different users. The images that go through Twitter's servers every day number in the billions with a B, and they have to figure out how to quickly get them to their 330 million users, even if those users are far away from Twitter's data centers. A large part of the solution is using content delivery networks, or CDNs, which are distributed storage networks that you can learn more about here. This way, devices will have a semi-nearby server to pull images from. But what about the images themselves? Well, Twitter uses both PNG and JPEG images. Both are compressed, which saves bandwidth compared to using huge uncompressed images that can easily take up around 35 megabytes if shot with a typical smartphone camera. However, PNGs use lossless compression, meaning their higher quality but take up significantly more space than a JPEG. Typically, Twitter will convert most images to JPEG if the PNG version has a high color depth, meaning that if they support 16-bit or a little over 65,000 colors, which actually isn't all that many considering modern displays support millions of colors. Additionally, JPEGs that take up more than 5 megabytes are also reduced in quality. But hold on a second, I use Twitter all the time and I think the images look pretty decent. How do they pull that off using so much compression? Keep in mind that Twitter still supports JPEGs up to about 16.7 megapixels, or about 4.2 megapixels if you're uploading from mobile. And when this service has to reduce to JPEG quality, it does so by only about 15%. Typically such a loss in quality isn't noticeable unless you're looking very closely, yet still saves a significant amount of bandwidth. And this is especially true since phone screens these days are very high resolution, yet small in size, so images can very easily be scaled down in resolution without a noticeable loss in visual fidelity. Many phone screens only have one red or blue pixel for every green, so trying to show a super high resolution photo on them would be a waste, as the phones can't even reproduce them accurately. If you compare these images to original side by side on a high-res desktop monitor, you may notice a difference. But for phone users who are often most impacted by speed constraints, the compression methods we've mentioned so far are no-brainers. Of course, sometimes noticeable trade-offs, even on mobile devices, cannot be avoided. Many people use social media services without fast connections, so if you're on a slow connection, you might notice that Twitter uses progressive JPEGs, meaning that a low-quality version will fully load first while you wait for the higher-res version, contrasting with the slowly loading image from top down as you probably remember from the dial-up era, if you're old. Then you have to factor in how people use many different devices, including some really old ones. This is a big part of the reason you might have noticed that Twitter header images often appear to be lower quality as they're capped at 500 pixels vertically to ensure that they can be shown correctly on legacy devices. But what about all the space these pictures take up on Twitter servers? Well, it turns out that storage isn't all that difficult to expand, so the choices that social networks make with how they process images has less to do with drive capacity and more to do with how to use as little bandwidth as possible for the end user. Who has an extra five seconds to wait for the next zesty Linus meme to load? Am I right? Not me. So thanks for watching, guys. If you liked this video, give it a like, give us a subscribe, and be sure to hit us up in the comments section with your suggestions for future topics that we should cover."}