Gradient Optimization in Photoshop

    The material is more likely for beginner typesetters, for example, those who work at Microsoft;) One picture from one popular page prompted the topic :

    image

    The fact is that the picture weighs 55,211 bytes. And here she is , but already the size of 1,764 bytes. If you think that the difference is in the format (I have png, and in the original gif), then you are only partly right. Try to save the original image in png, you are unlikely to get a serious win (I got 45 kb in size). In general, the matter is not in the format.

    It's all about the way to rasterize a gradient.


    To get started, let's think about how to draw a gradient.

    For simplicity, we assume that we have one color component, gray. We need a gradient from color 10 to color 20 (from completely black to slightly lighter) with a height of 40 pixels. But what about the program that draws the gradient, if the intermediate color values ​​are 10, and the gradient height is 40 pixels? She has 2 options: either make strips of 4 pixels of the same color, or apply some tricky masks so that the adjacent pixels were of different colors, but their overall intensity changed uniformly. It is clear that the second method may be more pleasant for the eyes when, as the first, it is much better compressible. To at least illustrate the differences, I set the contrast to almost maximum for my and Microsoft pictures:

    image

    Duck what about photoshop?


    But which of these algorithms does Photoshop use? It depends on whether you have this checkmark in the “gradient” toolbar:
    image

    In addition, if the gradient is drawn with the “Gradient overlay” effect on the layer, then the gradient will always be without dither.

    I think it’s clear that in this case, a gradient without dither would be a good choice. It is he who is applied in my picture.

    But there are cases when the gradient without dither does not look very good:
    image

    It may not be noticeable on every monitor, but this gradient consists of separate diagonal stripes of color.

    At the same time, the dither option looks much better:
    image

    True, it weighs, like the picture with which it all began, 50+ kilobytes. For such cases, I would recommend saving the image in jpg format with a quality of 100. From this, the quality will not deteriorate much, but the size will be acceptable - 8 kb .

    Also popular now: