📜 ⬆️ ⬇️

The program for converting images for the purpose of introduction into the html page

To output a picture to an HTML page, there is a standard tag in the form img src = "URL", where the URL specifies the address of the loaded picture. Those. to download each of the pictures will be a separate appeal to the server. There is a technique that allows you to embed images directly into the html code, the image tag will look like this in this case:
img src = "data: image / jpg; base64, iVBORw0KGgoAAAANSUhEUgAAADIA ....."
As a result, all the pictures will be immediately sewn into the page, and only one request to the server will be required.
The disadvantage of this solution is an increase in the weight of the image by about 1.3 times.
To automate the process of getting base64 strings, I wrote a small program. Allows you to process images in batch, and has several modes for saving.
Archive with source code, program and installer (600kb)

PS attention, the program is compiled under win!

')

Source: https://habr.com/ru/post/95192/


All Articles