{"id":21400,"date":"2016-07-27T13:15:52","date_gmt":"2016-07-27T13:15:52","guid":{"rendered":"http:\/\/a_one_color_image_is_worth_two_thousand_words"},"modified":"2025-02-23T15:00:46","modified_gmt":"2025-02-23T23:00:46","slug":"a_one_color_image_is_worth_two_thousand_words","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words","title":{"rendered":"Compressing a Single-Color Image in Various Formats"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>In <a href=\"https:\/\/cloudinary.com\/blog\/one_pixel_is_worth_three_thousand_words\">part one (One pixel is worth three thousand words)<\/a> of this turned-to-be-two-part blog post, I discussed one-pixel images and how well different image formats \u201ccompress\u201d these images. I was surprised how much there is to be said about the matter. This was supposed to be a short blog post, describing one-pixel images and how they compress, and instead it became a glorious monster (and also a two part blog post\u2026).<\/p>\n<p>Seems that my fellow image compression enthusiasts were as excited as I am about this subject! This blog post sparked a fascinating <a href=\"https:\/\/www.reddit.com\/r\/programming\/comments\/4tqtva\/1_pixel_in_various_image_formats_png_gif_webp_bpg\/\">Reddit discussion<\/a>, in which other formats like <strong>BMP<\/strong> and <strong>TIFF<\/strong> are considered, and a 141-byte one-pixel JPEG file was given (smaller than the 160-byte JPEG file that I thought was minimal).<\/p>\n<p>With that in mind, I\u2019m happy to introduce part two, where we\u2019ll look at <strong>single-color images<\/strong> and examine them in length. I hope you find it interesting and would love to hear your thoughts and insights!<\/p>\n<h2>The most predictable image<\/h2>\n<p>As we saw in part one, single-pixel images are the worst-case scenario for image compression: they\u2019re all headers and overhead, and very little data. You can\u2019t really compress anything, since compression depends on predictability, and how are you supposed to predict one single pixel?<\/p>\n<p>In this second part of the blog post, we go to the other extreme: <strong>extremely predictable images<\/strong>.<\/p>\n<p>The most predictable image is a large rectangle in a single color. In other words, a scaled-up version of the one-pixel images I discussed in part one. An empty canvas, if you want. A blank sheet.<\/p>\n<p>Compression algorithms should be really good at compressing an image where every pixel is the same color. It\u2019s the best-case scenario, the ultimate in predictability \u2013 once you\u2019ve seen the first pixel, you\u2019ve seen them all.<\/p>\n<p>Let\u2019s take a single white pixel and scale it up to increasingly larger squares, and see how the various image formats perform. I wrote a little script to do just that. Here\u2019s the result:<\/p>\n<a href=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/comparison_single_color_square_images_white.png\" target=\"_blank\">\n<img loading=\"lazy\" decoding=\"async\" alt=\"Comparison of single color square images in white\" height=\"450\" src=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/w_640,dpr_2.0\/comparison_single_color_square_images_white.png\" style=\"margin: 0 auto;display: block\" title=\"Comparison of single color square images in white\" width=\"640\">\n<\/a>\n<p>Since we\u2019re looking at squares, the number of pixels is, well, the square of the number on the x-axis: as the width of the square goes from 1 to 5000 pixels, the size of the image goes from 1 pixel to 25 megapixels. So it\u2019s not surprising that some of the curves look like quadratic \u00a0functions. The uncompressed <strong>PBM<\/strong> format obviously has a file size that is (asymptotically) linear in the number of pixels (1 bit per pixel in this case). But <strong>JPEG<\/strong> and <strong>lossy WebP<\/strong> are also linear in the number of pixels (quadratic in the width of the square) \u2013 just with a better constant factor. In other words, they seem to have some inevitable cost per pixel. For JPEG, it looks like you need at least 2 bits per 8&#215;8 macroblock.<\/p>\n<p>This means that JPEG and lossy WebP have a <strong>theoretical limit on the compression ratio<\/strong> you can achieve with them: you can\u2019t do better than 0.031 bits per pixel (for JPEG) or 0.014 bits per pixel (for lossy WebP).<\/p>\n<p>Most of the other formats do not seem to have such a limitation. They do not look like a quadratic curve in the above plot. Let\u2019s see what we have here.<\/p>\n<ul>\n<li>\n<strong>GIF<\/strong> has a rather peculiar curve: it keeps going in a straight line for quite a while, but then it\u2019s like it \u2018shifts gears\u2019 twice: first at some point just before 3000&#215;3000, and then again \u00a0just after 4000&#215;4000. I don\u2019t know the explanation for this behavior.<\/li>\n<li>The <strong>PNG<\/strong> curve goes in a more or less straight line, with some \u2018coughs\u2019 and \u2018jumps\u2019 around powers of two (1024, 2048, 4096) which might be due to the changing behavior of the underlying zlib compression at such boundary points.<\/li>\n<li>\n<strong>Lossy BPG<\/strong> and <strong>lossless BPG<\/strong> are quite close to one another \u2013 you can tell that these are just two different settings of the same compression algorithm, in contrast to WebP where the lossy and the lossless variant are completely unrelated algorithms. The weird thing with BPG is that the file size fluctuates up and down quite strongly as the image gets larger. It\u2019s easier to see this if you zoom in on part of the plot:\n<a href=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/comparison_single_color_square_images_white_zoom.png\" target=\"_blank\">\n<img loading=\"lazy\" decoding=\"async\" alt=\"Comparison of single color square images in white - zoom\" height=\"450\" src=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/w_640,dpr_2.0\/comparison_single_color_square_images_white_zoom.png\" style=\"margin: 0 auto;display: block\" title=\"Comparison of single color square images in white - zoom\" width=\"640\">\n<\/a>\n<\/li>\n<\/ul>\n<p>For example, a 568&#215;568 white square takes 232 bytes as a lossless BPG, while a slightly larger 569&#215;569 white square takes only 144 bytes. <em>Weird<\/em>.<\/p>\n<ul>\n<li>\n<strong>Lossless WebP<\/strong> has a nice low curve: a 25 megapixel white square (5000&#215;5000) still only takes 1012 bytes.<\/li>\n<li>\n<strong>FLIF<\/strong> is the king of this competition: it doesn\u2019t matter what the image dimensions are, if all pixels are white, the FLIF file will be 19 bytes. This is a side-effect of a more general, quite simple compression technique FLIF uses. For each color channel (in this case there is only one: luma), the header can optionally contain a lower bound and an upper bound on the values that actually occur in the image. By reducing the range of values, better compression can be achieved. In this case, the range is reduced to one single value (white, or 255 if you express it as an 8-bit number). Once you know that this is the range, every pixel becomes as cheap as it can be: exactly zero bits.<\/li>\n<\/ul>\n<p>In the plots above, it\u2019s still a bit hard to see the asymptotic behavior of the various formats. Let\u2019s plot the data in a different way: let\u2019s look at the relative file size, i.e. the bits needed per pixel. Instead of looking at the number of bits per pixel, which would be very small, let\u2019s look at the number of pixels per bit. The bang for the buck, so to speak. Here is a plot of the compressed white squares, with pixels per bit on the (logarithmic) Y-axis:<\/p>\n<a href=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/comparison_single_color_square_images_white_pixels_per_bit.png\" target=\"_blank\">\n<img loading=\"lazy\" decoding=\"async\" alt=\"Comparison of single color square images in white - pixels per bit\" height=\"450\" src=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/w_640,dpr_2.0\/comparison_single_color_square_images_white_pixels_per_bit.png\" style=\"margin: 0 auto;display: block\" title=\"Comparison of single color square images in white - pixels per bit\" width=\"640\">\n<\/a>\n<p>As expected, <strong>uncompressed PBM<\/strong> very quickly converges to 1 pixel per bit, as the overhead of the header and padding becomes less and less important. <strong>JPEG<\/strong> and <strong>lossy WebP<\/strong> also quite quickly converge to what appear to be their theoretical limits \u2013 32 pixels per bit, and just above 70 pixels per bit, respectively.<\/p>\n<p><strong>GIF<\/strong> is more interesting: it keeps getting more and more pixels per bit, until it almost gets to 200 pixels per bit. It then seems to repeatedly bump its head against that ceiling.<\/p>\n<p><strong>PNG<\/strong> quite rapidly goes over that 200 ppb ceiling and keeps getting better, though above about 1000&#215;1000, the improvement gets much slower and bumpier.<\/p>\n<p><strong>BPG<\/strong> and <strong>lossless WebP<\/strong> behave in a similar way: first they get better and better very rapidly, but then improvement gets slower and the pixels per bit curve becomes nearly horizontal. They can both achieve more than 1000 pixels per bit.<\/p>\n<p><strong>FLIF<\/strong> \u2018cheated\u2019 by not having to encode anything at all, so obviously it rapidly grows and keeps growing.<\/p>\n<p>How far can we take this? Well, the largest image dimension that is supported by all of the above formats, is 16383&#215;16383 pixels (268 megapixels). Let\u2019s see what we get for this huge white square:<\/p>\n<div style=\"margin-left: 0pt;\" dir=\"ltr\">\n<table style=\"border: none; border-collapse: collapse;\"><colgroup><col width=\"100\" \/><col width=\"100\" \/><col width=\"100\" \/><\/colgroup>\n<tbody>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; font-style: italic; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Format<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; font-style: italic; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Bytes<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; font-style: italic; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Pixels per bit<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 20px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">PBM<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">33,552,399<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">1.00<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">PNG<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">53,132<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">631.45<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">GIF<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">182,225<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">184.11<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">JPEG<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">1,048,737<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">31.99<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Lossy WebP<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">477,334<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">70.29<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Lossless WebP<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">10,368<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">3,235.95<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Lossy BPG<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">16,734<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">2,004.90<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Lossless BPG<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">18,032<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">1,860.60<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">FLIF<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">19<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">1,765,807<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Would there be any difference if the huge square was black instead of white? Let\u2019s look at the pixels-per-bit plot.<\/p>\n<a href=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/comparison_single_color_square_images_black_pixels_per_bit.png\" target=\"_blank\">\n<img loading=\"lazy\" decoding=\"async\" alt=\"Comparison of single color square images in black - pixels per bit\" height=\"450\" src=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/w_640,dpr_2.0\/comparison_single_color_square_images_black_pixels_per_bit.png\" style=\"margin: 0 auto;display: block\" title=\"Comparison of single color square images in black - pixels per bit\" width=\"640\">\n<\/a>\n<p>And here are the numbers for a huge 268-megapixel black square:<\/p>\n<div style=\"margin-left: 0pt;\" dir=\"ltr\">\n<table style=\"border: none; border-collapse: collapse;\"><colgroup><col width=\"100\" \/><col width=\"100\" \/><col width=\"100\" \/><\/colgroup>\n<tbody>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; font-style: italic; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Format<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; font-style: italic; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Bytes<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; font-style: italic; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Pixels per bit<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">PBM<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">33,552,399<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">1.00<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">PNG<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">32,645<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">1,027.73<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">GIF<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">182,225<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">184.11<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">JPEG<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">1,048,737<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">31.99<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Lossy WebP<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">477,334<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">70.29<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Lossless WebP<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">10,366<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">3,236.57<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Lossy BPG<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">16,734<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">2,004.90<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">Lossless BPG<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">18,032<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">1,860.60<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 0px;\">\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">FLIF<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">15<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: bottom; padding: 3px 3px 3px 3px; border: solid #000000 1px;\">\n<p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt; text-align: center;\" dir=\"ltr\"><span style=\"font-size: 12px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;\">2,236,689<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>It turns out that for some formats, there actually is a difference between black and white squares, and black is always more compact than white. In <strong>PNG<\/strong>, it makes quite a big difference: a huge white square is 53 KB, while a huge black square is only 32 KB. Also, the pixels-per-bit curve looks much smoother for black squares than for white squares.<\/p>\n<p>You might wonder what causes this difference between white and black in <a href=\"https:\/\/cloudinary.com\/tools\/compress-png\">PNG<\/a>. The explanation is that the image data in a PNG is basically PNM+zlib, with one important difference: a \u201cfilter\u201d can be applied to make the data compress better. PNG supports <a href=\"https:\/\/www.w3.org\/TR\/PNG\/#9Filters\">five filter types<\/a> (None, Sub, Up, Average and Paeth), and each image row can have a different filter. Every row gets prefixed with one extra byte which indicates the filter type for that row.<\/p>\n<p>Now what is the <strong>best way to encode a fully white image in PNG<\/strong>? Well, it does not really matter much which filter type you use \u2013 whichever you pick, the actual filtered data bytes will either be mostly 0 or mostly 255. The thing is, if you pick filter type None (encoded as 0), then the filtered data is all 255, while if you pick any other filter type (encoded as 1 to 4), then the filtered data becomes mostly all zeroes. In any case, you don\u2019t get a big sequence of identical bytes \u2013 there is an interruption at the beginning of each row. You get a repetitive pattern, with a length that depends on the width of the image. This explains the jumps around widths that are a power of two: those are the points where zlib needs more bits to represent the <a href=\"https:\/\/en.wikipedia.org\/wiki\/LZ77_and_LZ78\">LZ77 distances<\/a>.<\/p>\n<p>A <strong>fully black image<\/strong> is easier: you can just pick filter type 0. The filtered data is all zeroes whatever you do, so the data to be compressed is one big sequence of only zeroes. And that is pretty much the best-case scenario for zlib, so you get pretty close to <a href=\"http:\/\/www.zlib.net\/zlib_tech.html\">zlib\u2019s theoretical limit<\/a>, which is a 1032:1 compression ratio.<\/p>\n<p>A <strong>fully transparent image<\/strong> gets more or less the same compression as a fully black image, for the same reason: it\u2019s one big sequence of zeroes (just a longer sequence because there\u2019s the extra alpha channel).<\/p>\n<p>If you examine the 32 KB huge black square PNG file, you\u2019ll notice that even though it is already compressed over a thousand times, the resulting compressed data is still very repetitive. In other words, the compressed data can be compressed even further. Indeed: running gzip on this 32 KB PNG file produces a .gz file of just 225 bytes.<\/p>\n<div style=\"padding: 10px 0; margin: -10px 0\" title=\"We couldn't resist creating this border as a one pixel image... :-)\">\n<img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/1px_black.png\" width=\"100%\" height=\"1\" style=\"max-height: 1px; max-width: 100%\" alt=\"We couldn't resist creating this border as a one pixel image... :-)\"  title=\"We couldn't resist creating this border as a one pixel image... :-)\">\n<\/div>\n<p>Wow. This was a pretty long and technical blogpost, and yet we\u2019ve only covered the <strong>simplest possible kind of images<\/strong>: first one single pixel, and then the same single pixel scaled-up to larger and larger squares. While these are certainly not the most useful, nor the most representative types of images, they can still tell us something about the limits of the image formats which we have considered: <strong>PNG, GIF, JPEG, uncompressed PNM\/PAM, lossy and lossless WebP and BPG, and FLIF<\/strong>. We\u2019ve seen the worst-case and the best-case behavior of these image formats: from 160 bytes for a single pixel, all the way down to 15 bytes for 268 megapixels.<\/p>\n<p>If you made it this far, congratulations! I hope you learned something new while reading all of this. I sure did while writing it!<\/p>\n<\/style>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":21401,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[128,157,179,321],"class_list":["post-21400","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-gif","tag-image-formats","tag-jpeg","tag-webp"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Compressing a Single-Color Image in Various Formats<\/title>\n<meta name=\"description\" content=\"Analyzing single color images, the size difference when compressing them in various image formats and the impact the single color has on the compression\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Compressing a Single-Color Image in Various Formats\" \/>\n<meta property=\"og:description\" content=\"Analyzing single color images, the size difference when compressing them in various image formats and the impact the single color has on the compression\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-27T13:15:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-23T23:00:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"263\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Compressing a Single-Color Image in Various Formats\",\"datePublished\":\"2016-07-27T13:15:52+00:00\",\"dateModified\":\"2025-02-23T23:00:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words\"},\"wordCount\":7,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA\",\"keywords\":[\"GIF\",\"Image Formats\",\"JPEG\",\"WebP\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2016\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words\",\"url\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words\",\"name\":\"Compressing a Single-Color Image in Various Formats\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA\",\"datePublished\":\"2016-07-27T13:15:52+00:00\",\"dateModified\":\"2025-02-23T23:00:46+00:00\",\"description\":\"Analyzing single color images, the size difference when compressing them in various image formats and the impact the single color has on the compression\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA\",\"width\":500,\"height\":263},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Compressing a Single-Color Image in Various Formats\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Compressing a Single-Color Image in Various Formats","description":"Analyzing single color images, the size difference when compressing them in various image formats and the impact the single color has on the compression","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words","og_locale":"en_US","og_type":"article","og_title":"Compressing a Single-Color Image in Various Formats","og_description":"Analyzing single color images, the size difference when compressing them in various image formats and the impact the single color has on the compression","og_url":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words","og_site_name":"Cloudinary Blog","article_published_time":"2016-07-27T13:15:52+00:00","article_modified_time":"2025-02-23T23:00:46+00:00","og_image":[{"width":500,"height":263,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words"},"author":{"name":"","@id":""},"headline":"Compressing a Single-Color Image in Various Formats","datePublished":"2016-07-27T13:15:52+00:00","dateModified":"2025-02-23T23:00:46+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words"},"wordCount":7,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA","keywords":["GIF","Image Formats","JPEG","WebP"],"inLanguage":"en-US","copyrightYear":"2016","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words","url":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words","name":"Compressing a Single-Color Image in Various Formats","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA","datePublished":"2016-07-27T13:15:52+00:00","dateModified":"2025-02-23T23:00:46+00:00","description":"Analyzing single color images, the size difference when compressing them in various image formats and the impact the single color has on the compression","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA","width":500,"height":263},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/a_one_color_image_is_worth_two_thousand_words#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Compressing a Single-Color Image in Various Formats"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649724681\/Web_Assets\/blog\/one_color_image_analysis\/one_color_image_analysis.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=21400"}],"version-history":[{"count":3,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21400\/revisions"}],"predecessor-version":[{"id":36985,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21400\/revisions\/36985"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/21401"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=21400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=21400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=21400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}