Scanline filtering is important for us because we can use them: in particular, we can do some image manipulation to make filtering better. As you may already have guessed, such data will be compressed very effectively. The filter “Sub” sends the message to the decoder: “Take the value of the left pixel and add it to the current value.” In this case, it’s 1. I wrote “can be packed” because in this ideal test case the “Sub” filter (number 1 before each line) will give much better result: For example, 15 pixels of value 0 can be written as 0(15) and this is much shorter than fifteen 0’s-this is how compression works in common. And such data would be compressed better if the image was relatively large. The “Up” filter sends the message to the PNG decoder: “For the current pixel take the value of the above pixel and add it to the current value.” We have 0 value for lines 2-5 because all pixels in each vertical line have the same color. Number 2 before each line represents applied filter, which is “Up” in this case. Let’s see how this image data can be packed by scanline filtering: Such images will have a very poor compression ratio in GIF, because it compresses colors that spread horizontally. Here is a schematic view of this image (each number represents a unique color):Īs you can see, all identical colors spread vertically, not horizontally. For example, we have a 5×5 pixels image with horizontal gradient. It introduced some cool features for image packing and compression, but for us – web designers and developers – the most important one is the scanline filtering (also known as ‘delta filters’). They have some common features (like indexed color palette), but PNG is much better than GIF in every aspect. PNG was developed as an open-source replacement of the proprietary GIF format.
#Open png in photoshop with transparency professional
This is a key concept behind professional image optimization. Each graphic format has its own advantages and weaknesses knowing them will allow you to modify original image for better visual quality and compression. Efficient Image Resizing With ImageMagickīefore we dive into image optimization techniques, we have to learn some technical details about the PNG format.How Optimized Are Your Images? Meet ImageOptim-CLI.We’ll start with some essentials about the PNG format and will then move to advanced optimization techniques.
These techniques are derived from laborious hours spent on studying how exactly the PNG encoder saves data. This post describes some techniques that may help you optimize your PNG-images. Well, in this post we’ll try to debunk this myth.
Some of you may even think that this format is “unoptimizable”.
As a Photoshop (or any other image editor) user you might think that there is not that many options for PNG optimization, especially for truecolor PNG’s (PNG-24 in Photoshop), which doesn’t have any. It’s a lossless, robust, very good replacement of the elder GIF image format. We’ll start with some essentials about the PNG format and will then move to advanced optimization techniques.Īs a web designer you might be already familiar with the PNG image format which offers a full-featured transparency.