As the click-through rate of blog articles increases, the use of paid image hosting services becomes increasingly burdensome. The high storage costs and bandwidth consumption have deterred many people, making the search for free or low-cost alternatives to image hosting a pressing need.
What is an Image Hosting Service?#
Many people are confused about why they need to go through the trouble of setting up an image hosting service and what it is used for.
Take Obsidian as an example. It is a text editor, and when you insert an image into an article, it is stored locally as a link in the attachments. If you are writing an article just for yourself and not posting it on any online platforms, then you don't need an image hosting service, and there's no need to read further.
Once the article needs to be published on online platforms like WeChat Official Accounts and Zhihu, copying the article to each publishing platform without uploading the images to an image hosting service will result in the loss of the images. In this case, you can manually upload the local images in the backend and reinsert them into the article.
If there are many images and you need to consider their placement in relation to the content, how many steps would you need to take?
First, rename all the images in the order they appear in the article, then upload them in bulk to the backend, and manually insert the images before or after the paragraphs in the article.
Sometimes, if you accidentally place the images in the wrong position, you have to start over, which can be quite annoying.
With an image hosting service, all these problems are solved.
With Obsidian, after arranging the article, you can upload the images to the image hosting service with just one click, and the local links will be replaced with external links. When you return, the images will be automatically replaced with the external links.
There are two common scenarios for using online images in regular article illustrations. Usually, some self-built blog platforms do not convert the images into other formats or links. They only render the articles, and the images are still hosted on the image hosting servers. When the images stored on the server are deleted, the illustrations in the blog articles will be lost.
Therefore, it is not recommended to use unreliable free third-party image hosting services. Once they shut down their servers, all the illustrations in the articles using that server's image hosting will be lost.
The other scenario is when you copy the article to various platforms, such as WeChat Official Accounts and Zhihu. They will automatically convert the online images into their own server images, effectively performing a batch upload and replacement operation.
The reason for doing this is to protect the copyright and security of the original content, and the images are subjected to security identification, which means that anti-leeching measures are applied to the images.
When you copy a WeChat Official Account article for other purposes, the illustrations in the article will be lost, and a prompt will appear: "This image is from WeChat Official Platform and cannot be referenced without permission."
From another perspective, if you directly render and reference the images from your own server, when the server is shut down or the images are accidentally deleted, the illustrations in the article will be lost.
In other words, once the article images copied from Obsidian are published on the platform, the image links have already been converted from your own cloud server to the respective platform's server.
This approach has its pros and cons. The advantage is that if you use a paid image hosting service, you don't have to worry about being charged based on the number of visits. As long as the platform doesn't go down, the images won't be lost. The downside is that you are not free to use the images on other platforms because the images converted to the platform have essentially been watermarked with anti-leeching measures.
If you publish an article on WeChat Official Accounts by uploading the images locally, when you publish the same article on Zhihu, you will need to upload the images again. Each platform has its own image storage and management system, and they do not share or automatically synchronize images.
The value of an image hosting service lies in its ability to allow you to reference images through an external link, enabling you to reuse the same set of images on multiple platforms, avoiding the hassle of repetitive uploads.
About Paid Image Hosting Services#
Therefore, it is necessary to find a reliable image storage service to prevent the loss of images in blog articles or other self-built platforms due to server failures.
I have been using Tencent Cloud Object Storage (COS) in combination with the open-source image upload tool PicList, which is based on PicGo but with additional features. It not only retains all the functions of PicGo but also adds many new features, such as album support and synchronized cloud file deletion.
In the past, if you wanted to delete an image that had been uploaded to a storage bucket, you had to manually delete it in the cloud service backend. With PicList, you can directly delete it in the tool's album, and it will be synchronized with the deletion of the image in the cloud. This feature is very useful for those who don't like redundant images.
In summary, an image hosting service is a service that allows you to efficiently publish articles with images to multiple platforms without manually uploading each image.
As your blog's readership increases, the pressure on paid image hosting services also increases.
Tencent Cloud Object Storage charges fees, and it's not easy for ordinary people to understand. In short, you have to pay for uploading, as well as for others to browse and download.
From this year's bill, it is clear that as the readership of articles increases, the cost of image hosting also increases.
I don't actually have many images in my articles, usually three to five, but even so, the cost has gone from 10 yuan to 30 yuan per month.
In other words, you have to pay to share your articles with others.
So, are there any free and reliable image hosting object storage services available?
Cloudflare, known as the "Internet Cyber Bodhisattva," is not just a name. Among them, R2 is a completely sufficient free image hosting service for personal use.
Suppose you upload an image that is 1MB in size. With Cloudflare R2's free quota, you can upload ten thousand images per month, and the download and access by others are almost free.
I have now set up Cloudflare R2 as the default image hosting service, and although it took some time to learn during the configuration, the transition from paid to free has been smooth.
Setting Up Cloudflare R2#
I originally wanted to write a setup process myself, but I found that other bloggers have already written very detailed instructions, and I followed the tutorial step by step without any obstacles. Therefore, I will not go into the specific setup process here. For beginners, please refer to the reference links at the bottom of the article.
Although the setup and configuration process is simple, I encountered some small issues along the way. If you encounter similar problems, you can try the following solutions.
Images can be uploaded but not displayed correctly#
The subdomain can be filled in when creating Cloudflare R2. As long as it is a domain purchased through Cloudflare, it will automatically associate with the CHAME target. In other words, when configuring the R2 custom domain, simply enter the corresponding subdomain, and Cloudflare will automatically create the CHAME and associate it with R2.
In other tutorials, the custom domain is often created first and then associated.
I encountered the first hurdle when Cloudflare R2 and Piclist were configured correctly, and the images could be uploaded correctly but not displayed correctly. The links in the uploaded images in Cloudflare R2's backend were different from the local links.
I found that the /
in the custom domain in the Piclist configuration needed to be changed from https://img.lenband.com to https://img.lenband.com/my-img.
Where did "my-img" come from? It is the name of the storage bucket created in R2.
Tinypng Image Compression Plugin#
After correctly configuring the image hosting service, I also installed a Tinypng plugin, which can compress the image size while maintaining clarity. It works by calling the Tinypng API online to compress the uploaded images.
After enabling this plugin, there was obvious lag when uploading images. It was fine if it was a bit slow, but today when I uploaded a GIF of about 4MB, it gave an error. So I disabled this plugin.
Because I found another image optimization solution.
WebP Cloud Intelligent Image Optimization Proxy Service#
WebP Cloud can significantly reduce the size of images without significantly affecting the image quality, speeding up the overall loading speed of the website, and it has intelligent proxy caching capabilities.
Similar to call forwarding, when you call Cloudflare R2, WebP Cloud acts as an intermediary and optimizes the images during the forwarding process.
Upload Image → Cloudflare R2 → WebP Cloud Optimizes Image → Obtain Image
The setup is simple. Enter the Cloudflare R2 custom domain, for example: https://img.lenband.com/my-img, into WebP Cloud, and enter the proxy link obtained after optimization into the Piclist configuration.
Free users have a daily quota of 2000 free requests, which means they can proxy 2000 image access requests and provide 100MB of image cache. This is sufficient for personal blog use.
When I uploaded this article and found a problem, when I used the WebP Cloud proxy link, the blog platform supported it perfectly. However, when I copied it to WeChat Official Accounts and Zhihu in China, the images were lost. Zhihu gave a direct error.
So I changed the configuration back to the Cloudflare R2 custom domain, without using WebP Cloud image optimization. WeChat Official Accounts could recognize it, but Zhihu still couldn't.
Solution: After publishing the article on WeChat Official Accounts, use the Chrome plugin "Sync Assistant" → Zhihu.
Some people may ask why I went through all this trouble. Because I don't have money.
Cloudflare has many other free projects, such as free blog hosting, R2 image storage service, domain redirection, free DNS service, email routing service, and free protection against DDoS attacks. The name "Internet Cyber Bodhisattva" comes from these projects.
Reference Links#
Cloudflare R2 + WebP Cloud + PicGo
https://www.pseudoyu.com/en/2024/06/30/free_image_hosting_system_using_r2_webp_cloud_and_picgo/
Building a Personal Image Hosting Service Using Cloudflare R2
https://www.lihuanyu.com/en/2024/07/using-cloudflare-r2-to-build-a-personal-image-hosting-service/
Using Cloudflare R2 to Store and Build a Blog Image Hosting Service
https://ysicing.me/cloudflare-r2