K
K
keslo2015-10-15 10:01:45
css
keslo, 2015-10-15 10:01:45

How is the image generated?

Good afternoon.
How is the final image of ice cream generated here after choosing a color?
b17d4675bfad4f20b197d93f163a9a27.png
The image tag looks like this:

<img id="preview_image" class="img-responsive" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzkAAAJ9CAYAAAAWrL...тут куча символов...==">

Perhaps there are ready-made libraries for creating something like this? Or tutorials? I would be grateful for links.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Torbeev, 2015-10-15
@keslo

base64 encoding. Instead of linking to an image, the src attribute is set to the image itself.
You can encode and decode an image at codebeautify.org/base64-to-image-converter
for more information about base 64 and why it is needed, here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question