This combines any mix of PNG, WebP, GIF, BMP, or JPG images into a single PDF, one image per page, using the pdf-lib library entirely inside your browser. JPGs are embedded directly since PDF supports that format natively; every other format is first rasterized onto a canvas — flattening any transparency onto the background color you pick — and re-encoded as PNG before being embedded, which keeps output consistent across formats that PDF doesn't support natively.
JPGs are embedded as-is with no re-encoding, so there's no additional quality loss beyond what the JPG already has. Other formats get rasterized to PNG first, which is lossless, so the pixels themselves aren't degraded — the main quality factor is the "Fit image" page size option versus A4/Letter, since scaling to a fixed page size can shrink or letterbox the image.
PDF pages don't support real transparency the way PNG does, so any transparent area is filled with the solid background color you choose — white or black — before the image is embedded. Pick whichever matches how you want transparent regions to look printed or viewed.
A4 and Letter create a standard-sized page and center your image inside the margins, scaling it down if it's larger than the page. "Fit image" instead makes the PDF page exactly match each image's own pixel dimensions, so nothing is cropped, padded, or rescaled — useful when you want the PDF to preserve the image's original proportions exactly.