Base64 image conversion using chrome hiding skills

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.