Sometimes, to convert an image to base64 or convert it back to an image, you may need to find online tools or software tools.
Of course, Chrome is also software, but fortunately there is chrome in front-end.
Let's take a look at a simple example. I just cut a desktop background for example.
Save as PNG and jpg respectively.
Then open the image in chrome, press F12 to open the console, and use sources or resources.
As you can see, the last arrow is the base64 data we need, which is very simple.
Of course, there is no data header here. You can add it when using it.
Data: image/jpg; base64. The base64 data is added here.
Of course, image/jpg is an image type. If you are lazy, you can use image/jpg.
If you want to be obsessive, write the corresponding type, such as image/PNG, image/GIF or something.
It's easy to convert an image to base64, which can be done in minutes.
Of course, it is very easy to convert base64 data into images,
Open Data: image/jpg, base64, and base64 in the address bar to display the image in the browser, and right-click to save the image.
Now, let's share this small knowledge point today.