Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

JPEG cannot store transparent pixels. When a browser-based converter turns a transparent PNG into a JPG, those pixels must be composited onto a solid color. White is not the universal default for browser canvas export: the HTML Standard specifies opaque black for canvas serialization to formats that do not support alpha. A converter that produces white is applying white somewhere in its own workflow, but the exact cause depends on the tool.

Why transparency disappears in a JPG

A PNG can represent transparency with an alpha channel, which records how opaque each pixel is. JPEG has no alpha channel. To create a JPEG, the conversion process has to combine transparent and partly transparent pixels with a background color, producing an opaque image.

For browser canvas serialization to a format without alpha, the WHATWG HTML Standard specifies compositing the image onto an opaque black background. That rule describes canvas serialization; it does not establish how every conversion website or app works. A particular tool may first paint its working canvas white or otherwise choose white as its compositing color.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to make the JPG background white—or another color

If you control the conversion code, explicitly paint the desired background before drawing the PNG. Then export the canvas as JPEG. This makes the intended color part of the workflow instead of relying on a converter’s default.

#1 Best Overall
Sale
Canon 7981A004 Photo Paper Plus, Matte, 8-1/2 x 11 (Pack of 50 Sheets)
  • Excellent photo results with vibrant colors.
  • Pack of 50 Sheets
const canvas = document.createElement("canvas");
canvas.width = image.naturalWidth;
canvas.height = image.naturalHeight;
const ctx = canvas.getContext("2d");
ctx.fillStyle = "#fff";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(image, 0, 0);
canvas.toBlob((blob) => {
  if (!blob) throw new Error("Could not create image");
  // Use or download the JPEG Blob.
}, "image/jpeg", 0.92);

Change "#fff" to the color you want. The fill must happen before drawImage(); otherwise the background will not be behind the PNG when it is composited.

Choose an export method and verify its result

Method What it returns When to use it
canvas.toBlob(callback, "image/jpeg", quality) An encoded Blob delivered asynchronously to the callback. Generally preferable for large images because it avoids turning the entire encoded image into an in-memory string.
canvas.toDataURL("image/jpeg", quality) A data URL string containing the encoded image. Useful when a string representation is needed, but large images can create memory and URL-length drawbacks.

Both methods accept a requested image type and a quality value for supported lossy formats. The requested type is not a guarantee: PNG is required, and a browser may fall back to PNG if it does not support the requested format. When the actual format matters, check the returned representation. MDN documents the behavior of toBlob() and toDataURL().

Rank #2
Sale
HP Everyday Photo Paper, Glossy, 8.5x11 in, 50 sheets (Q8723A)
  • Create affordable photo projects with a bright, glossy finish
  • Customize photos with easy-to-use editing tools and print from your phone with HP Smart app
  • Handle durable, quick-dry photos right from the printer
  • Make memories last with photos that resist fading for decades when printed with Original HP Ink
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why a browser converter may still fail to export

If the source PNG is loaded from another origin, canvas export can fail when the canvas is not origin-clean. MDN documents that toBlob() can throw a SecurityError in that situation. This is separate from the background-color issue: an explicit fill controls the output color, but it does not bypass cross-origin restrictions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a converter you do not control, check for a background-color setting or inspect its implementation to learn why it chose white. The canvas standard explains the serialization rule, but without knowing the tool, it cannot identify which step produced a white background.

Quick Recap

SaleBestseller No. 1
Canon 7981A004 Photo Paper Plus, Matte, 8-1/2 x 11 (Pack of 50 Sheets)
Canon 7981A004 Photo Paper Plus, Matte, 8-1/2 x 11 (Pack of 50 Sheets)
Excellent photo results with vibrant colors.; Pack of 50 Sheets
$7.19
SaleBestseller No. 2
HP Everyday Photo Paper, Glossy, 8.5x11 in, 50 sheets (Q8723A)
HP Everyday Photo Paper, Glossy, 8.5x11 in, 50 sheets (Q8723A)
Create affordable photo projects with a bright, glossy finish; Handle durable, quick-dry photos right from the printer
$16.99
Bestseller No. 4
Epson Value Photo Paper Glossy 4x6 100 sheets S400034
Epson Value Photo Paper Glossy 4x6 100 sheets S400034
Epson's Value Photo Paper is available in Letter and 4x6 sizes; Epson's Value Photo Paper is backed by Epson's Paper Satisfaction Guarantee
Best Value
CAREGY 40 Sheets Single Sided Glossy Photo Paper for Inkjet, 8.5x11 Inches,
  • Reliable quality and large capacity: Made from high-quality 180GSM/48lb paper, with uniform thickness and a smooth surface. Standard letter size (8.5 x 11 inches / 216 x 279 mm), 40 sheets per pack
  • Fast Ink Absorption & Smudge-Proof Performance:Features advanced coating technology for ultra-fast ink absorption. It prints without smudging and reduces waiting time. Ensures crisp images right after printing, ideal for high-efficiency office and home use
  • Vibrant, True-to-Life Color Reproduction:Optimized for dye ink to deliver rich, vivid colors and accurate color matching. With outstanding color fidelity, it accurately captures every image detail, ensuring precise and vivid presentation of photos, flyers, and other printed materials
  • Single-Sided Glossy Finish for Stunning Visuals:Boasts a premium single-sided glossy surface that enhances color vibrancy and image clarity. Ink Absorbent Coating prevents ink penetration and ensures stable stacking, perfect for creating professional-looking prints without bulk.The blank back provides handy space for your notes or explanations
  • Versatile Application Scenarios for All Your Needs:Ideal for a wide range of uses, including photo printing, promotional flyers, product brochures, classroom handouts and home crafts (like DIY chip bags). Compatible with most inkjet printers, meeting both professional and personal printing demands
Rank #4
Epson Value Photo Paper Glossy 4x6 100 sheets S400034
  • Epson's Value Photo Paper is available in Letter and 4x6 sizes
  • It works with all inkjet and Supertank printers and is ideal for home and business projects
  • Epson's Value Photo Paper is backed by Epson's Paper Satisfaction Guarantee
  • 100 Sheets of 4" x 6" glossy photo paper
Rank #3
Sale
Reastar Glossy Photo Paper 8.5 × 11, 36 Sheets Inkjet Photo Printer Paper
  • Photo Paper Package: 36 sheets of glossy photo paper, 8.5×11 inch, industry standard 180gsm/48lb, single-sided printing and blank back side for recording or writing something; compatible with inkjet printers and dye ink
  • Glossy Finish: our glossy photo paper features its a reflective finish, that adds a professional and attractive touch and makes every picture look like a work of art; the printed photos and graphics are so outstanding
  • Leave Vivid Colors: thanks to the good ink absorption of the picture paper, the printed photos come out vibrant colors and sharp details that truly come to life; remain beautiful landscapes and impressive moments forever
  • Instant Dry: due to the advanced super cast coating, the ink on prints dry quickly without smearing and jamming; plus, the prints retain their vibrant color over time; makes your memories and designs shine in their full glory
  • Wide Application: perfect for printing photos to record important and sweet moments, and also ideal for printing detailed graphics, various greeting cards, posters, chip bags, flyers, brochures, calendars, baby book

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.