WEBP to PNG API

Convert Modern WEBP Images to Universally Supported PNG Format.

hero banner

Code Examples in Popular Languages

Integrate our WEBP to PNG API easily into your apps with comprehensive code examples in popular languages to get started quickly.

CURL Request
curl --location 'https://theonlineconverter.com/api/v1/image-converter' \
--header 'Content-Type: application/json' \
--header 'x-api-key: enter_your_api_key' \
--form 'from="webp"' \
--form 'to="png"' \
--form 'file=@"/D:/data/Images/png/image.png"'
JavaScript Fetch
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("x-api-key", "enter_your_api_key");

const formdata = new FormData();
formdata.append("from", "webp");
formdata.append("to", "png");
formdata.append("file", fileInput.files[0], "/D:/data/Images/png/image.png");

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: formdata,
  redirect: "follow"
};

fetch("https://theonlineconverter.com/api/v1/image-converter", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
Ruby Net::HTTP
import requests
import json

url = "https://theonlineconverter.com/api/v1/image-converter"

payload = {'from': 'webp',
'to': 'png'}
files=[
  ('file',('image.png',open('/D:/data/Images/png/image.png','rb'),'image/png'))
]
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'enter_your_api_key'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
Python Requests
import requests
import json

url = "https://theonlineconverter.com/api/v1/image-converter"

payload = {'from': 'webp',
'to': 'png'}
files=[
  ('file',('image.png',open('/D:/data/Images/png/image.png','rb'),'image/png'))
]
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'enter_your_api_key'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
PHP Guzzle
<?php
$client = new Client();
$headers = [
  'Content-Type' => 'application/json',
  'x-api-key' => 'enter_your_api_key'
];
$options = [
  'multipart' => [
    [
      'name' => 'from',
      'contents' => 'webp'
    ],
    [
      'name' => 'to',
      'contents' => 'png'
    ],
    [
      'name' => 'file',
      'contents' => Utils::tryFopen('/D:/data/Images/png/image.png', 'r'),
      'filename' => '/D:/data/Images/png/image.png',
      'headers'  => [
        'Content-Type' => '<Content-type header>'
      ]
    ]
]];
$request = new Request('POST', 'https://theonlineconverter.com/api/v1/image-converter', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
Java HttpURLConnection
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("from","webp")
  .addFormDataPart("to","png")
  .addFormDataPart("file","/D:/data/Images/png/image.png",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("/D:/data/Images/png/image.png")))
  .build();
Request request = new Request.Builder()
  .url("https://theonlineconverter.com/api/v1/image-converter")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("x-api-key", "enter_your_api_key")
  .build();
Response response = client.newCall(request).execute();
Go net/http
package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "net/http"
  "io"
)

func main() {

  url := "https://theonlineconverter.com/api/v1/image-converter"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  _ = writer.WriteField("from", "webp")
  _ = writer.WriteField("to", "png")
  file, errFile3 := os.Open("/D:/data/Images/png/image.png")
  defer file.Close()
  part3,
         errFile3 := writer.CreateFormFile("file",filepath.Base("/D:/data/Images/png/image.png"))
  _, errFile3 = io.Copy(part3, file)
  if errFile3 != nil {
    fmt.Println(errFile3)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("x-api-key", "enter_your_api_key")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
C# HttpClient
var options = new RestClientOptions("https://theonlineconverter.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/v1/image-converter", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("x-api-key", "enter_your_api_key");
request.AlwaysMultipartFormData = true;
request.AddParameter("from", "webp");
request.AddParameter("to", "png");
request.AddFile("file", "/D:/data/Images/png/image.png");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);

Key Features & Capabilities

Our API is built with essential features to ensure perfect WEBP to PNG conversions every time.

Simple User Interface

Lossless Quality Conversion

Convert WEBP images to PNG without any loss of quality. Our process ensures that every detail of your original image is perfectly preserved.

Simple Data Format

Transparency Preservation

Full alpha channel transparency is maintained during conversion, making it perfect for logos, icons, and web graphics that require a transparent background.

Time

Universal Compatibility

The primary goal of this API is to create PNG files that are universally supported across all browsers, email clients, and legacy software where WEBP may fail.

Secure Data

Animated WEBP Support

Automatically convert animated WEBP files into the animated PNG (APNG) format, preserving all frames and animation timing.

Universal Access

Fast & Scalable

Engineered for high-speed conversions, our API can handle large image files and high-volume requests, scaling to meet your application's needs.

Freedom

Secure & Confidential

All images are processed over encrypted connections. We guarantee confidentiality with a strict data privacy policy and do not store your files.

Frequently Asked Questions

Find answers to common questions about our WEBP to PNG API to help you understand its capabilities and best use cases.

The main reason is compatibility. While WEBP is a modern and efficient format, it is not supported by all browsers, email clients, or older software. Converting to the universally supported PNG format ensures your images are visible to all users on all platforms.

No. Our conversion process is lossless. The output PNG will have the same pixel-for-pixel quality as the source WEBP image.

Transparency is fully preserved. If your WEBP image has a transparent background (alpha channel), the resulting PNG file will also have a transparent background.

Animated WEBP files are automatically converted into the animated PNG (APNG) format. All frames and animation data are preserved, so your animation will play correctly.

Our API is designed to handle large image files. Specific size limits are based on your subscription plan and can be found in our detailed documentation.

We use end-to-end TLS encryption for all data transfers. Your image files are processed securely and are permanently deleted from our servers immediately after the conversion is complete.

Conversions are typically completed in just a few seconds. The exact time can vary slightly depending on the image dimensions and server load, but our API is optimized for speed.