<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Image Compression - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Image Compression - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Thu, 28 May 2026 16:47:28 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/image-compression/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ Image File Types – The .jpeg, .svg, and .png Picture Format Extensions Explained ]]>
                </title>
                <description>
                    <![CDATA[ When you’re working with images, it’s important to understand the different file types. Which format is best for what application? In this tutorial, we’re going to explain the most common image file types, and when you should use them. Note that this... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/image-file-types-picture-format-extensions-jpeg-gif-png-svg-tiff/</link>
                <guid isPermaLink="false">66b8d4450c9c1d363b7c422e</guid>
                
                    <category>
                        <![CDATA[ Image Compression ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Quincy Larson ]]>
                </dc:creator>
                <pubDate>Sat, 09 Apr 2022 22:26:12 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/timon-klauser-3MAmj1ZKSZA-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>When you’re working with images, it’s important to understand the different file types. Which format is best for what application?</p>
<p>In this tutorial, we’re going to explain the most common image file types, and when you should use them.</p>
<p>Note that this is a short, non-technical article. If you want to go much deeper on the performance side of things, read these guides on <a target="_blank" href="https://www.freecodecamp.org/news/tag/image-optimization/">how to optimize your website's images for the web</a>.</p>
<p>First, a quick explanation of how image compression works.</p>
<h2 id="heading-lossless-vs-lossy-what-is-the-difference-between-these-two-compression-types">Lossless vs Lossy – What is the Difference Between These Two Compression Types?</h2>
<p>Lossless compression is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data.</p>
<p>There is only so much you can compress a file before you start throwing away <em>some</em> of the information that file contains.</p>
<p>This is where "Lossy" compression comes in. Lossy in that it loses some of the information.</p>
<p>Lossy compression permits reconstruction only of an approximation of the original data (though usually with greatly improved compression rates).</p>
<p>You will see both the terms "Lossless" and "Lossy" appear below when we describe different image file formats.</p>
<h2 id="heading-what-is-the-jpeg-format-jpg-and-jpeg-file-extension">What is the JPEG Format? (.jpg and .jpeg file extension)</h2>
<p>JPEG is the most common file type for images. It’s best used for photos and other images with lots of colors.</p>
<p>By the way, JPEG stands for Joint Photographic Experts Group – the team that developed the standard.</p>
<p>JPEG files are smaller than other file types, so they’re easy to download and share.</p>
<h3 id="heading-can-jpegs-be-transparent-or-have-a-transparent-background">Can JPEGs be transparent or have a transparent background?</h3>
<p>No. Unlike GIFs, SVGs, and PNGs, JPEGs cannot have transparent backgrounds. You would need to convert your JPEG to a different file format.</p>
<h3 id="heading-are-jpeg-and-jpg-are-the-same">Are .jpeg and .jpg are the same?</h3>
<p>Yes – the only difference is that, traditionally, file extensions are only 3 characters long. ".jpg" is a shortened form of ".jpeg".</p>
<h2 id="heading-what-is-a-png-the-png-file-format-png-file-extension">What is a PNG? The PNG File Format (.png file extension)</h2>
<p>PNG is a lossless compression format for digital images. PNG was created as an improved replacement for GIF. It has become the most widely-used lossless image compression format on the web.</p>
<p>PNG is a file type that’s best used for images with transparency, like logos. PNG files are usually larger than JPEGs, so they’re not ideal for large images.</p>
<p>PNGs can have a transparent background.</p>
<h2 id="heading-what-is-a-gif-the-gif-image-format-gif-file-extension">What is a GIF? The GIF Image Format (.gif file extension)</h2>
<p>The GIF format is another type of image file that is commonly used on the web. GIF files are typically smaller than other image file types, making them ideal for use on the web.</p>
<p>GIFs can be used for static images. But they are more commonly associated with animations – a series of images that auto-play. For example, here's a public domain GIF.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/Globespin.gif" alt="Image" width="600" height="400" loading="lazy">
<em>A public domain GIF of the spinning globe</em></p>
<p>This is really just a series of a dozen or so images playing in a loop.</p>
<p>Note that GIFs can also have a transparent background.</p>
<h3 id="heading-how-do-you-pronounce-gif">How do you pronounce GIF?</h3>
<p>The creator of the GIF format, Stephen Wilhite, said that he pronounced "jif" as in "Jif" peanut butter.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/6398248857_42ff8de345_h-1.jpeg" alt="Image" width="600" height="400" loading="lazy">
<em>Jif peanut butter. Creative Commons photo by Brian Cantoni.</em></p>
<p>This said, almost all the developers I know pronounce it "gif", as in "gift", and I think that will continue to be the most popular way to say it.</p>
<div class="embed-wrapper">
        <blockquote class="twitter-tweet">
          <a href="https://twitter.com/FallonTonight/status/1011823951167750144?s=20&amp;t=hGaYcvhV9J8H5n9pv9Em_A"></a>
        </blockquote>
        <script defer="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></div>
<h2 id="heading-what-is-a-tiff-the-tiff-image-format-tif-file-format">What is a TIFF? The TIFF Image Format (.tif file format)</h2>
<p>TIFF is a file type that it's best to use for high-quality images that need to be edited. TIFF files are large, so they’re not ideal for sharing online.</p>
<p>You should use a TIFF when quality is more important than file size. In practice, a PNG is almost always a better option – especially when dealing with images on the web.</p>
<h2 id="heading-what-is-an-svg-the-svg-file-format-svg-file-extension">What is an SVG? The SVG File Format (.svg file extension)</h2>
<p>An SVG is a Scalable Vector Graphic. This means that the graphic can be scaled to any size without losing quality.</p>
<p>Unlike all the other file formats we're discussing in this article, SVG files are vector files. (JPEG, PNG, GIF, and TIFF are raster files.)</p>
<p>This means that SVG files can be scaled to any size without losing quality, while raster files will lose quality when they are scaled up.</p>
<p>You can edit SVG files using vector editing software (or just manually update the coordinates and colors of the graphics). You can only edit a PNG files using raster editing software.</p>
<p>Here is an example SVG file from the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Getting_Started">Mozilla Developer Network</a>. This is what SVG looks like in its native XML code form:</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">svg</span> <span class="hljs-attr">version</span>=<span class="hljs-string">"1.1"</span>
     <span class="hljs-attr">width</span>=<span class="hljs-string">"300"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"200"</span>
     <span class="hljs-attr">xmlns</span>=<span class="hljs-string">"http://www.w3.org/2000/svg"</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">rect</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"100%"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"100%"</span> <span class="hljs-attr">fill</span>=<span class="hljs-string">"red"</span> /&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">circle</span> <span class="hljs-attr">cx</span>=<span class="hljs-string">"150"</span> <span class="hljs-attr">cy</span>=<span class="hljs-string">"100"</span> <span class="hljs-attr">r</span>=<span class="hljs-string">"80"</span> <span class="hljs-attr">fill</span>=<span class="hljs-string">"green"</span> /&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">text</span> <span class="hljs-attr">x</span>=<span class="hljs-string">"150"</span> <span class="hljs-attr">y</span>=<span class="hljs-string">"125"</span> <span class="hljs-attr">font-size</span>=<span class="hljs-string">"60"</span> <span class="hljs-attr">text-anchor</span>=<span class="hljs-string">"middle"</span> <span class="hljs-attr">fill</span>=<span class="hljs-string">"white"</span>&gt;</span>SVG<span class="hljs-tag">&lt;/<span class="hljs-name">text</span>&gt;</span>

<span class="hljs-tag">&lt;/<span class="hljs-name">svg</span>&gt;</span>
</code></pre>
<p>And this simple code renders this image:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/example-svg-file.png" alt="Image" width="600" height="400" loading="lazy">
<em>A red square with a green dot and the letters "SVG" on it.</em></p>
<p>SVG files are usually smaller than PNG files, because they only contain the data necessary to draw the image, while PNG files contain the data for the entire image.</p>
<p>You can also animate SVG files using a tool called SMIL. Thus, they can serve as extremely space-efficient GIF files. And if you're really adventurous, you can program SVGs.</p>
<h2 id="heading-jpegs-vs-pngs-which-image-format-is-best-for-the-web">JPEGs VS PNGs – Which Image Format is Best for the Web?</h2>
<p>The web may look very different in the future, as we roll out more and more fiberoptic cable, and high speed satellite internet becomes more common.</p>
<p>But for now, my recommendation is to use JPEGs for most of your images.</p>
<p>If you have a company logo or a very important photo where quality is vital, PNG is a good option.</p>
<p>For logos, I recommend using an SVG, as it will scale infinitely, and is very compact in size.</p>
<h2 id="heading-i-hope-you-learned-a-lot-about-image-file-types">I hope you learned a lot about Image File Types.</h2>
<p>And I hope you've found this helpful. If you want to learn more about programming and technology, try <a target="_blank" href="https://www.freecodecamp.org/learn">freeCodeCamp's core coding curriculum</a>. It's free.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Resize an Image Without Losing Quality – Reduce File Size Tutorial ]]>
                </title>
                <description>
                    <![CDATA[ When you need to resize an image, you want to do it without losing quality. Fortunately, there are a lot of widely available tools that can help you do this. Resizing images can be tricky, because when you reduce the size of an image, you are also re... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-resize-an-image-without-losing-quality/</link>
                <guid isPermaLink="false">66b8d3f880f2fbfc1b20bbe6</guid>
                
                    <category>
                        <![CDATA[ Image Compression ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Quincy Larson ]]>
                </dc:creator>
                <pubDate>Mon, 04 Apr 2022 21:21:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/derick-mckinney-oARTWhz1ACc-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>When you need to resize an image, you want to do it without losing quality. Fortunately, there are a lot of widely available tools that can help you do this.</p>
<p>Resizing images can be tricky, because when you reduce the size of an image, you are also reducing the number of pixels. The more you reduce the number of pixels, the more you reduce the quality of the image. But there are ways to resize an image without losing quality.</p>
<h2 id="heading-how-to-resize-an-image-with-adobe-photoshop-without-losing-quality">How to Resize an Image with Adobe Photoshop Without Losing Quality</h2>
<p>One way to do this is to use a program like Photoshop. With Photoshop, you can resize an image without losing quality by using the "Image Size" dialog box.</p>
<p>To open the "Image Size" dialog box, open an image in Photoshop, click on the "Image" menu dropdown, then click on "Image Size":</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/photoshop-image-size-menu-option.jpg" alt="The &quot;Image&quot; menu dropdown with an arrow pointing to the &quot;Image Size&quot; menu option" width="600" height="400" loading="lazy"></p>
<p>In the "Image Size" dialog box, you can change the width and height of the image. You can also change the resolution. The resolution is the number of pixels per inch. The higher the resolution, the more pixels there are in the image, and the better the quality.</p>
<p>First, make sure that the "Resample Image" checkbox is unchecked:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/photoshop-image-size-dialog-box-resample-unchecked.jpg" alt="The &quot;Image Size&quot; dialog box with an arrow pointing to the &quot;Resample&quot; checkbox, which is unchecked" width="600" height="400" loading="lazy"></p>
<p>This checkbox tells Photoshop to change the number of pixels in the image. When you uncheck this box, Photoshop will not change the number of pixels, and the quality and file size of the image will not be reduced.</p>
<p>Next, select a unit of measurement to use to resize the image. Click on the dropdown to the right of either "Width" or "Height" to open a dropdown.</p>
<p>Inches is selected by default because Photoshop is used to produce a lot of print media. Note that, since the "Resample" checkbox is unchecked, you cannot select pixels from the units of measurement dropdown:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/photoshop-image-size-dialog-box-units-dropdown.jpg" alt="The &quot;Image Size&quot; dialog box with the units of measurement dropdown open and &quot;Inches&quot; selected and &quot;Pixels&quot; greyed out" width="600" height="400" loading="lazy"></p>
<p>After selecting a unit of measurement, change either the width or height of the image, and the other dimension will automatically update.</p>
<p>Finally, click the "OK" button to resize the image:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/photoshop-image-dialog-box-changed-height-ok-button.jpg" alt="The &quot;Image Size&quot; dialog box with arrows pointing to an updated height and the &quot;OK&quot; button" width="600" height="400" loading="lazy"></p>
<p>But there are times when losing a little bit of quality is okay, like if you're resizing and image for a website. In that case, the reduced image file size is good because images will load much faster.</p>
<p>In this case, make sure the "Resample" checkbox is checked. Then you can select pixels as a unit of measurement and resize the image as described above.</p>
<h2 id="heading-how-to-resize-an-image-using-microsoft-paint-without-losing-quality">How to Resize an Image Using Microsoft Paint Without Losing Quality</h2>
<p>Another way to resize an image without losing quality is to use a program like Microsoft Paint. With Paint, you can resize an image without losing quality by using the "Resize and Skew" dialog box.</p>
<p>To open the "Resize and Skew" dialog box, open an image, and in the "Image" section of the toolbar, click the "Resize and Skew" button:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/paint-resize-button.jpg" alt="Paint with an open image and an arrow pointing to the &quot;Resize and Skew&quot; button in the &quot;Image&quot; section of the toolbar" width="600" height="400" loading="lazy"></p>
<p>In the "Resize and Skew" dialog box, you can change the width and height of the image. You can also change the horizontal and vertical stretch. The horizontal and vertical stretch determine how much the image is stretched.</p>
<p>In the "Resize and Skew" dialog box, select either "Percentage" or "Pixels" as a unit of measurement, and make sure the chain icon between "Horizontal" and "Vertical" is connected. That will lock the aspect ratio of your image so it doesn't get distorted:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/paint-resize-and-skew-dialog-box.jpg" alt="Microsoft Paint's &quot;Resize and Skew&quot; dialog box" width="600" height="400" loading="lazy">
<em>Microsoft Paint's "Resize and Skew" dialog box</em></p>
<p>Then change either the horizontal or vertical dimension of the image, and the other one will automatically update.</p>
<p>Finally, click the "OK" button to resize the image.</p>
<h2 id="heading-how-to-resize-an-image-with-gimp-without-losing-quality">How to Resize an Image With GIMP Without Losing Quality</h2>
<p>You can also try using a program like GIMP. GIMP is a free program that you can download from the internet. With GIMP, you can resize an image without losing quality by using the "Scale Image" dialog box.</p>
<p>To open the "Scale Image" dialog box, open an image in GIMP, click on the "Image" menu dropdown, then click on "Scale Image":</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/gimp-scale-image-menu-option.jpg" alt="The &quot;Image&quot; menu dropdown with an arrow pointing to the &quot;Scale Image&quot; menu option" width="600" height="400" loading="lazy"></p>
<p>In the "Scale Image" dialog box, select a unit of measurement from the dropdown box. "px", or pixels, is selected by default.</p>
<p>And make sure the chain icon between "Width" and "Height" is connected. That will lock the aspect ratio of your image so it doesn't get distorted:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/gimp-scale-image-units-and-chain-icon.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then change either the horizontal or vertical dimension of the image, and the other one will automatically update.</p>
<p>Also, in the "Interpolation" dropdown, select either "Cubic" or "Sinc (lanczos3)". </p>
<p>Finally, click the "OK" button to resize the image.</p>
<h2 id="heading-how-to-resize-an-image-in-your-browser-using-a-service">How to Resize an Image in Your Browser Using a Service</h2>
<p>If you don't have access to Photoshop, Microsoft Paint, or GIMP, you can use an online service like PicResize. Search for PicResize in your browser. Then you can upload an image and then choose the size you want. PicResize will resize the image without losing quality.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/PicResize_-_Crop__Resize__Edit_images_online_for_free__--.png" alt="Image" width="600" height="400" loading="lazy">
<em>A screenshot of PicResize</em></p>
<p>There are many other programs that you can use to resize an image without losing quality. These are just a few of the most popular programs.</p>
<p>I hope you've found this helpful. If you want to learn more about programming and technology, try <a target="_blank" href="https://www.freecodecamp.org/learn">freeCodeCamp's core coding curriculum</a>. It's free.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ HEIC to JPG – How to Convert Images on a Mac ]]>
                </title>
                <description>
                    <![CDATA[ If you're an Apple user, chances are you've seen the .heic file extension on your photos. And you might wonder – what is this photo format, and why does Apple use it? In this article we'll discuss what HEIC is, how it's different from the JPG format,... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/heic-to-jpg-how-to-convert-images-on-a-mac/</link>
                <guid isPermaLink="false">66b1fa2e3c37998c256a1d23</guid>
                
                    <category>
                        <![CDATA[ Image Compression ]]>
                    </category>
                
                    <category>
                        <![CDATA[ mac ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Photography ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Abigail Rennemeyer ]]>
                </dc:creator>
                <pubDate>Mon, 28 Sep 2020 16:18:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9881740569d1a4ca1a71.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you're an Apple user, chances are you've seen the .heic file extension on your photos. And you might wonder – what is this photo format, and why does Apple use it?</p>
<p>In this article we'll discuss what HEIC is, how it's different from the JPG format, why Apple uses it, how to convert from HEIC to JPG, and more.</p>
<h2 id="heading-what-is-the-heic-file-format">What is the HEIC file format?</h2>
<p>Well, first of all, .heic is the file extension that appears on HEIF files/images. HEIF stands for High Efficiency Image Format, and it was adopted by Apple in 2017. </p>
<p>As you might be able to guess from its name, photos stored in this way are "more efficient". That is, they're smaller while still maintaining their quality.</p>
<p>HEIF isn't actually a format, per se. Rather, it's a container in which the photo is stored that uses advanced compression techniques to squish that photo down into about half the size of a JPG.</p>
<p>A quick note, in case you're wondering: HEIF is the standard, and HEIC is the format name Apple gave it :) So I'll refer to it as HEIC in this article for simplicity's sake.</p>
<h2 id="heading-the-differences-between-heic-and-jpg">The differences between HEIC and JPG</h2>
<p>There are several important differences between HEIC files and JPG files. You might be more familiar with JPG, because it's been around longer and everyone (on any device) can use and view them easily.</p>
<p>So let's break down the main differences between these two formats:</p>
<h3 id="heading-operating-system-support-for-heic-vs-jpg">Operating system support for HEIC vs JPG</h3>
<p>One of the limiting factors of HEIC is that it's only natively supported by Apple's operating system (iOS 11 and higher, and MacOS High Sierra and higher).</p>
<p>But don't worry – even though your iPhone takes photos in HEIC, if you have iOS 11 or MacOS Sierra and higher you can easily convert these photos to JPG (more on that below).</p>
<p>That way you can share them with whomever you want without worrying if your buddy will be able to open them on their Android phone, for example.</p>
<p>If you're a Windows or Android user, you can't simply open a HEIF should you find yourself in possession of one. You'll need to download an extension or program to help you deal with it.</p>
<h3 id="heading-size-and-quality-of-heic-vs-jpg-photos">Size and quality of HEIC vs JPG photos</h3>
<p>Another main difference is the size of the photos, as mentioned above. HEIC photos are extra compressed, basically, so that they end up being about half the size of their JPG counterparts.</p>
<p>Also, despite that extra compression, HEIC photos still maintain their quality (and will actually be higher quality than a JPG of the same size). So you can actually get a better, higher resolution HEIF photo that's the same size as a not-so-high-quality JPG. Pretty neat.</p>
<h3 id="heading-compatibility-of-heic-vs-jpg">Compatibility of HEIC vs JPG</h3>
<p>As you now already know, you can't just casually open a HEIC file if you don't have a Mac or iPhone. That's one of it's major downsides, and the reason Apple's OS converts HEIC photos to JPG when you download them or go to share them.</p>
<p>JPG files, on the other hand, are compatible with all operating systems and browsers. So you can open a JPG anywhere.</p>
<p>Until the rest of the world adopts the HEIC format, you'll have to convert to JPG if you want an easy photo opening/viewing experience.</p>
<h3 id="heading-format-details">Format details</h3>
<p>There are a couple other interesting differences between HEIC and JPG. </p>
<p>First of all, HEIC photos have 16-bit "deep color", whereas JPG only have 8-bit. So your HEIC photos can capture all those beautiful sunset nuances a lot better than JPG.</p>
<p>Second, HEIC files can store multiple images or bursts or live photos (in a single file), whereas JPG can only store one image per file. This gives HEIC more flexibility and allows it to store more types of photos (and more than one photo per file).</p>
<h2 id="heading-how-to-convert-heic-to-jpg-on-your-mac">How to convert HEIC to JPG on your Mac</h2>
<p>If your Mac is running High Sierra or later, you can convert HEIC images to JPG right in your photo Preview App.</p>
<p>Note: if you haven't updated your OS, you'll need to use an online converter.</p>
<p>But back to our process - here's how to convert those images in a few simple steps.</p>
<h3 id="heading-step-1-select-the-photo-you-want-to-convert-to-jpg">Step 1: Select the photo you want to convert to JPG</h3>
<p>First you need to open Finder and get to your HEIC photos. I just searched for "heic" in the search bar, but if you have a folder where you keep them you can go there.</p>
<p>Next, select the photo(s) you want to convert, and right click on it (two-finger click on your laptop's trackpad). That will bring up a little menu like you see below:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/Finder-heic-image.png" alt="Image" width="600" height="400" loading="lazy">
<em>Right click on the image you want to convert</em></p>
<h3 id="heading-step-2-open-the-photo-with-the-preview-app">Step 2: Open the photo with the Preview App</h3>
<p>You'll select "Open with" (the second option for me) and then the default, "Preview" as you see in the image above.</p>
<p>Once you make those selections, it'll take you to the photo in the Preview App. </p>
<h3 id="heading-step-3-select-and-export-the-photo">Step 3: Select and export the photo</h3>
<p>Next, you need to choose "Edit" from Preview's menu bar, and then "Select All".</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/Convert-HEIC-edit-settings-1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Edit, then Select All</em></p>
<p>You'll see a little moving dashed line around the outside of the photo - this tells you your "select all" action worked.</p>
<p>Now, go back up to Preview's menu bar and select "File" and then "Export", like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/Export-HEIC-image.png" alt="Image" width="600" height="400" loading="lazy">
<em>You'll need to export your image - which then gives you the option to change formats.</em></p>
<h3 id="heading-step-4-convert-from-heic-to-jpg-format">Step 4: Convert from HEIC to JPG format</h3>
<p>Once you select "Export", you'll see the following box pop up:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/change-from-heic-to-jpeg.png" alt="Image" width="600" height="400" loading="lazy">
<em>Just change from HEIC to JPG and save and you're set!</em></p>
<p>You'll see that the "Format" is currently set to HEIC. Just click on HEIC and a little dropdown will show you all the other formats you can choose from (like in the image above). </p>
<p>Just select "JPG" instead and hit "Save". Then your photo will be converted into JPG! And you can confidently share away.</p>
<p>Just a quick note: you can also update where you want the photo saved. You can see in the image above that I have Desktop selected, but feel free to save to whatever location you like.</p>
<h2 id="heading-what-if-you-want-to-turn-heic-off">What if you want to turn HEIC off?</h2>
<p>So what if you don't want to deal with these steps and just want your phone to take JPG photos instead of HEIC?</p>
<p>You can do that by following these steps:</p>
<ol>
<li>Go to your iPhone's settings, and scroll down until you see "Camera" – select it</li>
<li>You'll see various settings, with "Formats" at the top – select it</li>
<li>You'll see two options, "High Efficiency" and "Most Compatible". It's likely set to "High Efficiency" by default (HEIC) so just change that to "Most Compatible" and that'll change it to JPG.</li>
</ol>
<p>And voilà, the photos you now take will be in JPG format.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Where do all the bytes come from? ]]>
                </title>
                <description>
                    <![CDATA[ By Colt McAnlis Great question Dion! I will answer it, and not just because you’re my new boss, but because it’s a good question. (but also because you’re my new boss.) I want to set something clear here though : we’re not really comparing Apples-to-... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/where-do-all-the-bytes-come-from-f51586690fd0/</link>
                <guid isPermaLink="false">66c3665640438b5931fe09ac</guid>
                
                    <category>
                        <![CDATA[ compression ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Game Development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Image Compression ]]>
                    </category>
                
                    <category>
                        <![CDATA[ learning ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 12 Dec 2015 19:39:33 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/0*qimWOyFboQoLx32R." medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Colt McAnlis</p>
<p>Great question Dion! I will answer it, and not just <em>because</em> you’re my new boss, but because it’s a good question. (but also because <a target="_blank" href="https://medium.com/ben-and-dion/heading-to-google-take-2-0-153841c6e1ae#.asvmj5s45">you’re my new boss</a>.)</p>
<p>I want to set something clear here though : we’re not really comparing Apples-to-Apples, so let’s define some technologies first.</p>
<h3 id="heading-how-mario-works">How Mario Works</h3>
<p>So let’s talk about how the original Super Mario game worked, from an asset perspective.</p>
<p>The original NES console was only designed to output images that were 256 wide by 240 high; meaning that the final image that needed to be displayed to the screen was 180kb in size.</p>
<p>Besides that, the NES only had 2kb of RAM. A cartridge itself could could hold 8k to 1mb of game data. So, there was no way to fit the entire game’s contents into main memory. Basically, a subset of the 1MB cartridge data must be loaded into the 2kb RAM and used to render the 180kb screen. How does one achieve that?</p>
<p><a target="_blank" href="https://en.wikipedia.org/wiki/Sprite_%28computer_graphics%29">SpriteSheets</a>.</p>
<p>Sprite sheets contain small tiles of graphics, that are re-used over and over again. For example, below is a remake of the original super mario sprite sheet:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/0*dwRaOKJJTu_i9TvZ." alt="Image" width="304" height="192" loading="lazy">
<em>It’s not the exact original sprite sheet, but you can get a sense of the small blocks of data that can be use over-and-over again.</em></p>
<p>Each small 16x16 pixel square represents a “tile” and artists would string these together to create the actual levels. The levels themselves, just became a giant 2D array of indexes into the sprite sheet. (I talk about this in a lot more detail in Lesson 3 of my <a target="_blank" href="https://www.udacity.com/course/html5-game-development--cs255">HTML5 Game Development course @ Udacity</a>, or in my book <a target="_blank" href="http://www.apress.com/9781430266976">HTML5 Game Development Insights</a>.) Tack on some <a target="_blank" href="https://en.wikipedia.org/wiki/Run-length_encoding">Run-Length-Encoding</a>, or some basic <a target="_blank" href="https://www.youtube.com/watch?v=Jqc418tQDkg">LZ77</a>, and you get a fairly compact format for levels.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/0*qimWOyFboQoLx32R." alt="Image" width="800" height="105" loading="lazy">
<em>Behold, that level that you parents could never complete.</em></p>
<p>So with concepts like tile-sheets and sprite-sheets, we can use a small set of images to create large scenes &amp; worlds. This is generally how most games work. Even 3D games will have a set of common textures that are applied multiple times and places throughout the game itself.</p>
<p>Now let’s talk about generic image compression.</p>
<h3 id="heading-how-images-are-compressed">How Images are compressed</h3>
<p>Here’s the “<em>not fair</em>” part of this comparison. Generic image compression algorithms have no domain knowledge about the pixels inside of them. JPG, PNG, WebP have all been designed for <em>photos</em> and not so much <em>game screens</em>. The result is that for a given 16x16 pixel block, these algorithms assume it’s unique among the image; Besides some color quantization, there’s no real logic added to determine if another 16x16 block could be an <em>exact duplicate</em> of the current one. This generally means there’s a lower-bound on how a given block of data is compressed.</p>
<p>For example, <a target="_blank" href="https://en.wikipedia.org/wiki/JPEG">JPG</a> breaks a given image into 8x8 pixel blocks, converts the RGB color space into the <a target="_blank" href="https://en.wikipedia.org/wiki/YCbCr">YCbCr</a> version, and then applies <a target="_blank" href="https://en.wikipedia.org/wiki/Discrete_cosine_transform">Discrete cosine transform</a> on them. It’s only <strong>after</strong> this step, does a lossless encoder come along, and see if it can match up common duplicate groups using DPCM, or RLE.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/0*xdUjGXy1FE9sgpqE." alt="Image" width="474" height="325" loading="lazy">
<em>A block-view of how JPG image compression works.</em></p>
<p>So, the only place where two blocks might get compacted into 1 block, is if their post-DCTd version is identical, and RLE can make stride recommendations. This doesn’t happen that often.</p>
<p><a target="_blank" href="https://www.youtube.com/watch?v=jHXzzHElFPk">Despite its other flaws</a>, PNG is much better in this regard. PNG compression is entirely lossless, (so your image quality is high, but your compression savings are low), and based on the DEFLATE codec, which pairs <a target="_blank" href="https://www.youtube.com/watch?v=Jqc418tQDkg">LZSS</a> along with <a target="_blank" href="https://www.youtube.com/watch?v=FdMoL3PzmSA">Arithmetic Compression</a>. The result is that long runs of similar pixels can end up being cut down to a much smaller size. This is why an image with a very uniform background will always be smaller as a PNG instead of a JPG.</p>
<h4 id="heading-the-below-image-is-a-59kb-png-file-while-the-jpg-image-is-106kb">The below image is a 5.9kb PNG file, while the JPG image is 106kb</h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/0*sUO8JCbLZc_i-524." alt="Image" width="800" height="387" loading="lazy">
<em>Since this image has lots of duplicate pixels (the blue sky background) compressors like PNG do a better job than their block-based JPG counterparts.</em></p>
<h3 id="heading-apples-vs-dragonfruit">Apples vs. Dragonfruit</h3>
<p>My point here is that it’s kinda unfair to compare game content to a single image on the internet.</p>
<p>From the game side, you start with a small set of re-usable tiles, and index them to build up your larger image, we can do this, because we know how the game is going to be made. On the other side, JPG/PNG/WebP just tries to compress the data it can find in local blocks, without any real desire to match repeated content. Image compression is clearly at a disadvantage here, since they don’t have prior knowledge of their data space, they can’t really make any expectations about it.</p>
<p>I mean, consider <a target="_blank" href="https://en.wikipedia.org/wiki/Demoscene">The Demo Scene</a> which is super big on this <a target="_blank" href="https://en.wikipedia.org/wiki/.kkrieger">sort of thing</a>. They can cram 30minutes of an entire 3d shooter into 64kb because they understand and know so much more about their data.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*KFIQVD2tHQ3nu9GBEu3RWg.jpeg" alt="Image" width="800" height="209" loading="lazy">
_A much better comparison. The .[kkrieger](https://en.wikipedia.org/wiki/.kkrieger" rel="noopener" target="<em>blank" title=") demo fit 30 minutes of a 3D shooter gameplay, with physics, sound, textures, and AI into 64kb of data. Seems like a massive amount of gain for just 24kb more than the original Mario.</em></p>
<p>It just goes to show, with the right amount of foreknowledge about your data, you can do great things with compression.</p>
<h3 id="heading-looking-forward">Looking forward.</h3>
<p>Obviously, we’ve grown up since the 256x240 displays of the NES days. <a target="_blank" href="https://www.google.com/nexus/5x/">The phone in my pocket</a> has 1,920 x 1,080 display pixels @ it’s 5.2” size, giving it ~423 pixels per inch density. To compare that in the same number of pixels that’s ~33 super-mario screens, or rather, 8MB of pixel data. I don’t think anyone’s surprised that screen resolutions are increasing, but it also comes with the need for <em>more data</em>.</p>
<p>This is something I’ve been <a target="_blank" href="https://www.youtube.com/watch?v=dmX2MpEBYhw">harping on for a while now</a>. While we get bigger displays, the content channels need to up their resolution outputs in order to still look good on our higher-density setups (otherwise, <a target="_blank" href="http://www.leemunroe.com/designing-for-high-resolution-retina-displays/">we get scaling blurryness..</a>). This of course, causes our video game packages to grow in size, our <a target="_blank" href="http://royal.pingdom.com/2011/11/21/web-pages-getting-bloated-here-is-why/">web-pages to grow in size</a>, and even our <a target="_blank" href="http://mashable.com/2014/01/03/youtube-4k-ces/">youtube streaming videos</a> to grow in size. Basically, we’re sending more data to smaller devices simply due to screen resolution. Which, for the next 2 billion folks in emerging markets, on 2G connections, is like the worst idea ever.</p>
<p>But I digress. That’s a different post.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
