Preface#
Currently, MarkDown is a lightweight markup language that is essential for programmers. It avoids the tediousness of reformatting rich text editors when changing platforms, allowing us to focus on technical output. However, using Markdown also has its drawbacks, such as the storage of images. Markdown files must use a link when using images. Each platform has its own image storage method, and when the same article is published on different platforms, the images need to be uploaded separately. It is too troublesome to store them all locally.
Currently, the best solution is to use an image hosting service to store images.
Popular Public Image Hosting Services#
Image Hosting Service | Description |
---|---|
sm.ms | Registration required, overseas server [Free] |
meotu | Registration required, domestic server [Free] |
z4a Image Hosting | Registration required, domestic server [Free] |
imgtp | No registration required, domestic server, maximum support 15MB [Free] |
imgbed | No registration required, domestic server, maximum support 20MB [Free] |
Aggregate Image Hosting | Registration required, domestic server [Free] |
Niupic | No registration required, Japanese server [Free] |
imgbb | No registration required, Asia-Pacific server [Free] |
upload | No registration required, overseas server [Free] |
catbox | No registration required, overseas server [Free] |
Passing Image Hosting | Registration required, overseas server [Free] |
TG Image Hosting | Registration required, domestic and overseas servers [Free] |
Postimages | No registration required, fast foreign server [Free] |
imgloc | No registration required, domestic server, maximum support 6MB [Free] |
Yinghua Image Hosting | No registration required, aggregated CDN image hosting [Free] |
Meet Image Hosting | No registration required, aggregated CDN image hosting [Free] |
Hello Image Hosting | Registration required, domestic CDN [Free] |
IM.GE | No registration required, Hong Kong CDN [Free] |
Cloud Image Hosting | Global CDN [Free] |
Before uploading images, it is recommended to compress them to reduce space usage and effectively speed up image loading. Here are some good compression tools:
Online Tools:
The difference between the two is that TinyPNG is lossless compression, while Imagestool is lossy compression, but the difference cannot be seen with the naked eye.
Local Tools:
- Format Factory
Image Hosting Management Tools#
After selecting a good image hosting service, the next step is to upload and use images. At this time, you will face a problem: you have to go to the image hosting service to upload the image, then copy the link, and then go back to the platform where you want to use the image to paste it. It's very troublesome. Therefore, image hosting management tools have emerged to help us quickly upload images and obtain image URL links, saving us the trouble of manual operations.
Here are some excellent image hosting management tools:
- PicGo Official Website and Github Address (Windows system, Mac system)
- VScode-PicGo Plugin
- ShareX Official Website and Github Address (Windows system)
- uPic Official Website and Github Address (Mac system)
- PicUploader Official Website and Github Address (Windows system, Mac system)
- uPgit (Windows system, Mac system, Linux system)
PicGo is highly recommended. PicGo supports smms, Upyun, Qiniu Cloud, Alibaba Cloud OSS, Tencent Cloud COS, Weibo, Github, Gitee, Amazon S3, and custom upload interfaces (supports other storage options as well). It can also compress images before uploading, eliminating the need for separate compression tools.
Other Solutions#
Using Major Platforms for Free#
Here, we are referring to using websites such as Jianshu, Cnblogs, Xiaohongshu, Zhihu, and Bilibili to obtain image links. These websites generally have anti-leeching measures, but the speed is fast, especially for domestic nodes.
Direct Usage:#
The "Meet Image Hosting" and "Yinghua Image Hosting" mentioned in the popular free image hosting services section utilize the upload interface of major platforms, allowing direct usage.
Recommended Browser Extensions:#
- Jike Image Hosting (Login required for some interfaces)
- Introduction: Supports Alibaba/Jingdong/Baidu/Tencent/58 Tongcheng/Meituan and other global CDN accelerations, supports HTTPS!
- Official Website: https://test2.jiketuchuang.com/
- Bilibili Image Hosting
- Introduction: Upload to Bilibili to obtain direct links
- Download: Microsoft Edge Addons
Anti-Leeching Solutions:#
Empty referrer can bypass most anti-leeching measures. Add the following content to the head section:
<meta name="referrer" content="no-referrer">
Or add the no-referrer
header to the image:
<img src="example.com" referrerPolicy="no-referrer"/>
However, personally, I think the best option for image hosting is cloud storage or Baidu's "Yike" album (a bit troublesome). Even if major platforms strengthen their anti-leeching measures, you can still download the images to your local device and switch services.
Github + jsdelivr (Not Recommended)#
Due to the instability of jsdelivr, using it as an image hosting service is highly discouraged. Moreover, using this method as an image hosting service violates jsdelivr's TOS.
2. Abusing the service and its resources, or using jsDelivr as a general-purpose file or media hosting service. This includes, for example:
- running an image hosting website and using jsDelivr as a storage for all uploaded images,
- hosting videos, file backups, or other files in large quantities.
We recognize that there are legitimate projects that consist of a large number of files, and these are not considered abuse. For example: icons packs, apps, or games with a large number of assets.
NPM + NPM CDN#
{% link npm image hosting usage, https://anzhiy.cn/posts/72ea.html, https://img02.anzhiy.cn/adminuploads/1/2022/09/15/63232b7d91d22.jpg %}
backBlazeb2 + Cloudflare CDN#
References:
- GitHub - Rr210/blazeB2: 📷 Image hosting tool developed based on backBlazeb2 API & ⚡ cloudflare with CDN acceleration
- Preparation before Use | Blazeb2 Image Hosting
IPFS Image Hosting#
InterPlanetary File System (IPFS). IPFS is a distributed web, peer-to-peer hypermedia protocol. It can make our Internet faster, more secure, and more open. The goal of the IPFS protocol is to replace the traditional Internet protocol HTTP.
Self-Deployed Image Hosting Services#
There are many open-source projects on Github in this category, such as:
- GitHub - lsky-org/lsky-pro: ☁️ Lsky Image Hosting (Lsky Pro) - Your photo album on the cloud.
- GitHub - helloxz/imgurl: ImgURL is a simple and pure image hosting program, providing another choice for personal image hosting.
However, they are not recommended due to high deployment costs. If you have better suggestions or recommended image hosting services, please leave a comment in the comment section below.
Image to Base64 Conversion#
Convert images to text format for storage. They can be displayed in web pages and Typora. Here is a recommended tool:
Image to BASE64 Encoding | CaiNiao Tools
<!--Using Base64 in HTML-->
<img width="40" height="30" src="data:image/jpg;base64,/9j/4QMZRXhpZgAASUkqAAgAAAAL...." />
<!--Using Base64 in MD-->
![](base64)