Yahoo
Advertisement
Advertisement
Advertisement
Advertisement

This Self-Hosted File Converter Solved My WebP Woes

A Raspberry Pi next to a WebP file icon converting into another image file.
Lucas Gouveia/Jason Fitzpatrick/How-To Geek

The internet has taught me I can be sure of three things: death, taxes, and file upload fields that won't accept WebP images . I'm not aware of any self-hostable solutions to the first two problems, but the latter I was able to solve by running an open source service called ConvertX on my Raspberry Pi.

Why I'm Still Converting WebP Files

In a perfect world, I wouldn't be bothering with conversion and would instead be letting the WebP files I download live their happy, storage-efficient lives. The WebP format is actually good . It does the lossy compression job of JPEG, the lossless compression and transparency job of PNG, and the animation job of GIF—but better.

The trouble is not with WebP's functionality but with its support. Certain applications and websites ask for images but are unable to accept WebP files. The issue is less common than it used to be, but acceptance still isn't universal. It's totally up to developers to add WebP support, and until they do, I'm going to have to keep converting to JPEG and PNG.

My Problem With Free Online Converters

At this point you might be wondering why I don't just use one of those file conversion websites. For one thing, free online converters are generally unsafe . Even if a web app's privacy policy claims your files won't be stored by the owner, or that it'll have some kind of read protection or deletion schedule, you have no way of confirming those claims. Uploading a WebP file with sensitive content is a huge risk.

Advertisement
Advertisement

That's only the beginning, though. Websites you visit can always log your IP address and gather other data about you when you visit it. They're also often riddled with ads that slow down your computer and that sometimes outright try to confuse you into clicking on them instead of the converter interface. I just prefer to avoid these problematic sites altogether.

I Run My Own WebP Conversion With ConvertX

Since I don't want to rely on third party websites, but I also wanted those online converters' ease of use, I decided I'd just host my own. Fortunately, I didn't have to build it from scratch.

ConvertX is an open source file conversion service you host yourself using Docker . It has a dead-simple web interface you can bookmark for easy access. Drag-and-drop the files you want to convert, individually or in bulk, and then select the format you want. Click "Convert" and then wait for your ConvertX to do the conversion for you, locally—no dubious third party service required.

The ConvertX interface with five WebP files prepared for conversion.

ConvertX's interface is also optimized for mobile, so you can do conversions from your phone as well. Anyone on the local network can access and use ConvertX; they just need to know the login you create at the initial launch. With the technical know-how, you can also access the service from outside your home as you would any other server.

Advertisement
Advertisement

Technically, ConvertX just packages and automates several file and format utilities like VIPS, ImageMagick, FFmpeg, and more. That's why ConvertX gives you multiple options for converting to certain file formats; you have multiple utilities at your fingertips. If you aren't sure which to use, just use the first suggested utility. If you aren't happy with the results, try another.

Getting ConvertX Started

Anywhere you install Docker you can install and run ConvertX. I decided to install it on my Raspberry Pi where I already host multiple services. I use DietPi on my device to make installing new software a breeze, so I quickly got Docker and Docker Compose installed, then created a file called docker-compose.yml and pasted in this text I took from the ConvertX README :

Because I don't plan to make ConvertX available outside my home network, I felt safe uncommenting the HTTP line. For those unfamiliar with developer lingo, uncommenting means removing the first pound (#) symbol from the front of the line. This way I don't need any security certificates to get started.

After saving that file, I ran the docker composecommand. Then I hopped on my laptop's browser and typed in my Raspberry Pi's IP address followed by the default port, 3000. If I were running ConvertX directly on my laptop instead of the Pi, I'd just type localhost:3000into the address bar.

Advertisement
Advertisement

The first time you access ConvertX, you'll be prompted to enter an email and account password. Don't worry, there's no online registration going on here. Unless you specified the environment variable allowing for new account registrations, this email and password will be the one and only way for you to access ConvertX. The purpose of the login, even if you alone plan to use your ConvertX instance, is just to prevent unauthorized users from taking advantage of your file conversion resources.

ConvertX Isn't Limited to WebP

The ConvertX interface with several formats listed for conversion.

As you may have figured out already, ConvertX can handle many more file conversions than just WebP to JPG or PNG. It can also other image files, as well as a ton of document, video, and eBook file formats. Set up ConvertX and you might find yourself relying on it more than you expected.


There are other ways to avoid online converters and clunky image editors when working with WebP files. Mac Shortcuts are useful for automatic WebP conversion . You can batch-convert images in the Linux terminal , too.

Advertisement
Advertisement
Mobilize your Website
View Site in Mobile | Classic
Share by: