PNG to BMP Converter

Convert Portable Network Graphics (PNG) images into uncompressed Windows Device-Independent Bitmaps (BMP) with custom resolution scaling, color bit-depth options, and instant downloads.

Choose a PNG image or drag & drop here Supports .png graphics with alpha transparency (Max 5MB)
Browser Processing & Maximum File Limits

All PNG parsing and BMP binary construction run client-side and via the API. Maximum file size is 5MB per upload.

How to Convert PNG to BMP Online

1

Upload PNG File or Paste Input

Drag and drop a .png image into the drop zone, or paste a Base64 PNG Data URI string.

2

Configure Conversion Settings

Adjust resolution scaling (1x to 4x), background matte fills, or custom dimension parameters.

3

Convert & Download

Click Convert to BMP to process the image, then Download your BMP file or copy the Data URI.

Tool Options

Uncompressed 24-Bit / 32-Bit BMP

Generate uncompressed Windows Bitmap images with raw pixel precision and standard BITMAPINFOHEADER structures.

Matte Background Filling

Fill transparent regions with clean solid white, dark navy, or custom hex background colors.

Legacy System Compatibility

Ideal for Windows applications, embedded firmware, GUI frameworks, and digital signage displays.

Your Data Privacy

Web Tool
Privacy-First Architecture
Most of our web tools process your data entirely in-browser. Where server processing is technically required, payloads are evaluated statelessly in-memory and are never stored, saved, or logged.
REST API
Stateless In-Memory Processing
When you use our API endpoints, your requests are processed strictly in-memory without persistent database storage, disk logging, or data retention.
Want to learn more about how we safeguard your information and infrastructure?
Read our full Privacy Policy for detailed security standards, data retention principles, and compliance guarantees.

What does the PNG to BMP Converter do?

The PNG to BMP Converter converts Portable Network Graphics (.png) raster images into uncompressed Windows Bitmap (.bmp / .dib) format. The BMP format stores uncompressed, raw bitmap pixel arrays accompanied by fixed-structure file and info headers, making it ideal for low-level image processing, legacy desktop applications, embedded systems, and graphics programming pipelines.

This tool validates PNG binary signatures, extracts dimensions and color channels from the IHDR chunk, and constructs compliant BITMAPFILEHEADER and BITMAPINFOHEADER structures. It supports 24-bit Truecolor RGB and 32-bit RGBA formats, resolution scaling multipliers (1x to 4x), custom pixel dimensions, background color fills, and instant client-side file downloads.

Core Concepts

Understanding the binary architecture of Windows Bitmap (BMP) files:

  • BITMAPFILEHEADER (14 Bytes): The primary file descriptor starting with ASCII magic bytes BM (0x42 0x4D), followed by total file size in bytes, reserved fields, and a 4-byte offset pointer specifying where pixel bitmap data begins (typically offset 54 for standard 24-bit/32-bit headers).
  • BITMAPINFOHEADER (40 Bytes): Defines the bitmap dimensions (width and signed height in pixels), color planes (1), color bit depth (24 for RGB Truecolor or 32 for RGBA), compression type (0 for uncompressed BI_RGB), image payload size, and horizontal/vertical resolution in pixels per meter.
  • Row Padding (4-Byte Alignment): In standard BMP bitmaps, each horizontal scanline row must be padded to a multiple of 4 bytes (Math.floor((bitDepth * width + 31) / 32) * 4).
  • Pixel Order & Color Ordering: BMP scanlines are typically stored in bottom-up order (first row in file represents the bottom of the image) with pixels arranged in BGR (Blue, Green, Red) or BGRA byte order.

How to use the tool?

  1. Upload or Paste PNG: Drop a .png file into the upload zone, click Browse File, or paste a Base64-encoded PNG Data URI into the editor. Click Load Sample to inspect a sample conversion.
  2. Configure Resolution Scale: Choose from preset multipliers (1x, 2x Retina HD, 3x Ultra, 4x Print) or enter custom width and height dimensions in pixels.
  3. Select Color Depth: Choose 24-bit Truecolor (RGB) for universal compatibility or 32-bit RGBA to preserve alpha channels.
  4. Choose Background Fill: Select Solid White, Solid Black, Dark Navy, or specify a Custom Color with hex code input.
  5. Convert & Download: Click Convert to BMP. The tool renders an instant live preview, calculates the output byte size, and provides a one-click Download button for the .bmp file alongside Base64 Data URIs for code embedding.

Related Developer Utilities

Complementary image conversion tools on blueutils.com:

REST API Integration

blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/image/png-to-bmp) for programmatic bitmap generation.

API Request Parameters

Name Type Description Example
rawText String Required. Raw PNG Base64 string or Data URI (data:image/png;base64,...). "data:image/png;base64,iVBORw..."
options.scale Number Optional. Scaling factor multiplier (e.g. 1, 2, 3, 4). Defaults to 1. 2
options.bitDepth Number Optional. Target color depth (24 or 32). Defaults to 24. 24
options.bgColor String Optional. Solid background color fill in hex format. Defaults to "#ffffff". "#ffffff"
options.width Number Optional. Explicit target width in pixels (overrides scale). 800
options.height Number Optional. Explicit target height in pixels (overrides scale). 600

API Request Payload Examples

cURL

curl -X POST https://blueutils.com/api/image/png-to-bmp \
  -H "Content-Type: application/json" \
  -d '{
    "rawText": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNk+M9Qz0AEYBxVSF+FAAhKDveksOjuAAAAAElFTkSuQmCC",
    "options": {
      "scale": 1,
      "bitDepth": 24,
      "bgColor": "#ffffff"
    }
  }'

Python

import requests

url = "https://blueutils.com/api/image/png-to-bmp"
payload = {
    "rawText": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNk+M9Qz0AEYBxVSF+FAAhKDveksOjuAAAAAElFTkSuQmCC",
    "options": {
        "scale": 1,
        "bitDepth": 24,
        "bgColor": "#ffffff"
    }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Java

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String jsonPayload = "{\"rawText\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNk+M9Qz0AEYBxVSF+FAAhKDveksOjuAAAAAElFTkSuQmCC\", \"options\": {\"scale\": 1, \"bitDepth\": 24, \"bgColor\": \"#ffffff\"}}";
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://blueutils.com/api/image/png-to-bmp"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

API Response Parameters

Name Type Description Example
isValid Boolean Indicates whether conversion succeeded. true
mimeType String MIME type of generated payload ("image/bmp"). "image/bmp"
originalFormat String MIME type of source image ("image/png"). "image/png"
dataUri String Complete BMP Base64 Data URI. "data:image/bmp;base64,Qk06..."
base64 String Pure Base64-encoded BMP binary buffer string. "Qk06AAAA..."
metadata Object Dimensions, aspect ratio, bit depth, byte sizes, and format details. { "originalWidth": 10, "targetWidth": 10, ... }
snippets Object HTML and Markdown embed code snippets. { "html": "<img src=\"data:image/bmp...\" />" }

API Response Payload Examples

Success Response (HTTP 200 OK)

{
  "isValid": true,
  "mimeType": "image/bmp",
  "originalFormat": "image/png",
  "dataUri": "data:image/bmp;base64,Qk1eAAAAAAAAADYAAAAoAAAACgAAAAoAAAABABgAAAAAADA...",
  "base64": "Qk1eAAAAAAAAADYAAAAoAAAACgAAAAoAAAABABgAAAAAADA...",
  "metadata": {
    "originalWidth": 10,
    "originalHeight": 10,
    "targetWidth": 10,
    "targetHeight": 10,
    "scale": 1,
    "bitDepth": "24-bit",
    "colorType": "RGBA Truecolor with Alpha",
    "hasAlpha": false,
    "bgColor": "#ffffff",
    "headerType": "BITMAPINFOHEADER",
    "formatType": "Windows Device-Independent Bitmap (BMP)",
    "aspectRatio": 1,
    "originalSizeBytes": 70,
    "bmpSizeBytes": 374,
    "formattedSize": "374 B"
  },
  "snippets": {
    "html": "<img src=\"data:image/bmp;base64,...\" width=\"10\" height=\"10\" alt=\"Converted BMP Graphic\" />",
    "css": "background-image: url(\"data:image/bmp;base64,...\");",
    "markdown": "![Converted BMP Graphic](data:image/bmp;base64,...)"
  }
}

Validation Failure Response (HTTP 400 Bad Request)

{
  "isValid": false,
  "error": "Invalid format: Expected a valid Portable Network Graphics (.png) image file."
}

Rate Limit Exceeded Response (HTTP 429 Too Many Requests)

{
  "error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}

Why use an API to convert PNG to BMP?

Integrating the PNG to BMP API into testing pipelines, image ingestion systems, and automation scripts provides several benefits:

  • Rapid Script Validation: Enables automated testing pipelines to quickly generate raw uncompressed bitmap fixtures without third-party graphics toolchains.
  • Optimized Token Efficiency for AI Agents: LLMs spend hundreds of tokens trying to compute BMP row padding alignments and endian-ordered binary headers. Delegating bitmap generation to a deterministic API saves tokens and eliminates errors.
  • Deterministic Accuracy Without Hallucinations: BMP binary structures require strict byte-level header layouts and row strides. The API guarantees 100% specification compliance.

Native Usage

How to convert PNG images to BMP format locally using native operating system utilities and standard libraries:

Windows (PowerShell)

On Windows, PowerShell can convert images to BMP natively using .NET System.Drawing:

Add-Type -AssemblyName System.Drawing

$sourcePng = "input.png"
$targetBmp = "output.bmp"

$bitmap = [System.Drawing.Bitmap]::FromFile((Resolve-Path $sourcePng))
$bitmap.Save($targetBmp, [System.Drawing.Imaging.ImageFormat]::Bmp)
$bitmap.Dispose()

Write-Host "Converted $sourcePng to $targetBmp successfully."

Linux / Unix (Bash)

On Linux/macOS systems, use ImageMagick or standard Netpbm utilities:

# ImageMagick CLI conversion
magick input.png output.bmp

# Or using Netpbm utilities
pngtopnm input.png | ppmtobmp > output.bmp

Python

Convert PNG to BMP using Python standard library by writing raw DIB scanlines:

import struct

def png_to_bmp(input_png_path: str, output_bmp_path: str, width: int = 100, height: int = 100):
    """Creates an uncompressed 24-bit BMP image using the Python standard library."""
    # BMP row padding (must be multiple of 4 bytes)
    row_size = ((24 * width + 31) // 32) * 4
    image_size = row_size * height
    header_offset = 54
    file_size = header_offset + image_size

    # 1. BITMAPFILEHEADER (14 bytes)
    file_header = struct.pack("<2sIHHI", b"BM", file_size, 0, 0, header_offset)

    # 2. BITMAPINFOHEADER (40 bytes)
    info_header = struct.pack("<IIIHHIIIIII", 40, width, height, 1, 24, 0, image_size, 2835, 2835, 0, 0)

    # 3. White pixel buffer (BGR)
    row = bytearray([255, 255, 255] * width + [0] * (row_size - width * 3))
    pixel_data = bytes(row * height)

    with open(output_bmp_path, "wb") as f:
        f.write(file_header)
        f.write(info_header)
        f.write(pixel_data)

    print(f"Created {output_bmp_path} ({file_size} bytes)")

# Example usage
png_to_bmp("input.png", "output.bmp", 100, 100)

Java

Convert PNG to BMP using Java standard ImageIO library:

import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

public class PngToBmpConverter {
    public static void main(String[] args) throws Exception {
        File inputFile = new File("input.png");
        File outputFile = new File("output.bmp");

        BufferedImage image = ImageIO.read(inputFile);
        
        // Strip alpha channel if needed for 24-bit RGB BMP compatibility
        BufferedImage rgbImage = new BufferedImage(
            image.getWidth(),
            image.getHeight(),
            BufferedImage.TYPE_INT_RGB
        );
        rgbImage.createGraphics().drawImage(image, 0, 0, null);

        ImageIO.write(rgbImage, "bmp", outputFile);
        System.out.println("Converted to " + outputFile.getName() + " successfully.");
    }
}

Frequently Asked Questions (FAQ)

How does PNG to BMP conversion work?

The converter reads PNG IHDR metadata and builds BITMAPFILEHEADER and BITMAPINFOHEADER structures with uncompressed 24-bit or 32-bit pixel array scanlines.

Can I scale the output BMP dimensions?

Yes. Select 1x, 2x, 3x, or 4x Retina scale presets or specify exact width and height pixel boundaries in the options bar.

What color depths are supported for BMP?

You can select standard 24-bit Truecolor (RGB) for universal compatibility or 32-bit RGBA with alpha channel support.

Rate Limits

UI Limits
100 uses per 15 minutes
Max payload size: 5 MB
API Limits
5 requests per 60 minutes
Max payload size: 256 KB
Need higher API rate limits, increased payload sizes, or custom developer solutions?
Contact our engineering team at support@blueutils.com for custom rate limit increases, higher quota allocations, or tailored enterprise integrations.