Recommended Free Tools
In Python, Selenium’s screenshot-to-file methods produce PNG images; changing the filename to .jpg does not convert them. Get the screenshot as PNG bytes, open those bytes with Pillow, convert the image to RGB, and explicitly save it as JPEG.
Convert Selenium’s PNG screenshot bytes to JPEG
Install Pillow if it is not already in your environment: python -m pip install Pillow. Then capture the screenshot bytes and let Pillow encode them as JPEG:
As an Amazon Associate I earn from qualifying purchases.
from io import BytesIO
from PIL import Image
png_bytes = driver.get_screenshot_as_png()
with Image.open(BytesIO(png_bytes)) as image:
image.convert("RGB").save("screenshot.jpg", format="JPEG", quality=90)
This assumes driver is an initialized Selenium WebDriver. The Python API documents save_screenshot() as saving a PNG image; its filename extension does not select a different encoding. Selenium Python WebDriver API
get_screenshot_as_png() returns the PNG data as bytes. BytesIO makes those bytes available to Pillow as a file-like object, and format="JPEG" explicitly selects JPEG output. Pillow’s image-saving documentation describes the format option. Pillow JPEG documentation
#1 Best Overall
- 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
- Optical Zoom: 4x optical zoom with a 27mm wide angle lens for flexible framing indoors or outdoors
- Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
- Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
- LCD Screen and Battery: 2.7in LCD screen with 2 AA alkaline batteries for convenient on-the-go use
Choose JPEG quality and handle transparency
Quality and image fidelity
JPEG is lossy, so it can reduce file size at the cost of some image detail. The example’s quality=90 is a setting for that output, not a universal best value. Compare the resulting file with the PNG for your use case: sharp text, fine interface details, or pixel-exact comparisons may favor PNG. Pillow accepts a quality value when saving JPEGs. Pillow JPEG documentation
Transparency and background color
JPEG has no alpha channel. Calling convert("RGB") removes transparency, but it does not let you choose a deliberate background. If your source may contain transparent pixels, composite it over the background you want before saving. For example, this makes transparent pixels white:
Rank #2
- 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
- Optical Zoom: 5x optical zoom with a 28mm wide angle lens for flexible framing indoors or outdoors
- Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
- Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
- Rechargeable Battery: Included LB-012 lithium-ion battery charges in the camera over USB with the supplied adapter in about 2 hours; charge it for at least 4 hours before first use to maximize battery life
from io import BytesIO
from PIL import Image
png_bytes = driver.get_screenshot_as_png()
with Image.open(BytesIO(png_bytes)) as image:
rgba = image.convert("RGBA")
background = Image.new("RGB", rgba.size, "white")
background.paste(rgba, mask=rgba.getchannel("A"))
background.save("screenshot.jpg", format="JPEG", quality=90)
Pillow documents converting images to RGB before JPEG saving; the RGB conversion is necessary because JPEG cannot store an alpha channel. Pillow tutorial
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesUse a temporary PNG file if needed
If your workflow requires Selenium’s file method, save a genuine PNG first and convert that file separately. This uses an extra disk write and read, but produces the same kind of JPEG conversion:
Rank #3
- Latest Digital Camera Built-in Fill Light : This compact digital camera is paired with a powerful CMOS processor and image stabilization to help you take & record the most exciting moments in 44 MP quality images & FHD 1080P quality videos anywhere, anytime. Plus, there is also a built-in fill light to help you take high quality pictures even in low light&dark settings, making this the perfect camera for all indoors/outdoors situations.
- Long-Lasting Battery Life & 16X Digital Zoom :This point and shoot camera will retain its battery charge even after long use. The controls and functions are easy to operate making this the perfect choice for children, teens and younger. This kids camera supports 16x digital zoom, you can zoom in or out the subject by pressing the W/T button for taking still photos to zoom in or out on distant objects and capture all the details you need.
- Multifunctional & Portable Digital Camera: This cheap digital camera is slim enough to fit in your pocket. You'll easily be able to take it with you on all your indoor/outdoor activities and adventures and ideal for beginners, children and teenagers. This kids digital camera is equipped with 20 filters, anti-shaking, self-timer, continuous shooting, date stamp, time-lapse recording, smile capture, internal MIC and speaker (recording sound videos), great for your daily photography needs.
- WEBCAM & PAUSE FUNCTION : More than just a FHD 1080p digital camera, it also works as a webcam for video calls and vlogging. Connect the camera to the computer, press shutter and power button at the same time and the camera will automatically turn on webcam mode for all your video calling and live streaming needs. The pause function allows you to pause when seeing playback videos.
- A Must Have Photography Device : This digital camera with SD card made from high-quality materials, this retro camera is safe and durable. Perfect for all ages to develop & improve their photographic abilities and observation skills. Our dedicated and experienced 24/7 support team is available for all after purchase troubleshooting, questions and technical help.
from PIL import Image
driver.save_screenshot("screenshot.png")
with Image.open("screenshot.png") as image:
image.convert("RGB").save("screenshot.jpg", format="JPEG", quality=90)
Keep the PNG and JPEG extensions aligned with their actual encodings. Renaming PNG bytes to .jpg does not make them JPEG data.
Python differs from other Selenium bindings
Do not assume screenshot-format support is identical across Selenium languages. The cited .NET documentation shows an ITakesScreenshot example using SaveAsFile with a ScreenshotImageFormat value, and lists JPEG among its format options. The Python screenshot-to-file API cited above specifies PNG. Check the API documentation for the binding you use rather than transferring one binding’s behavior to another. Selenium screenshot documentation
Rank #4
- 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
- Optical Zoom: 5x optical zoom with a 28mm wide angle lens for flexible framing indoors or outdoors
- Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
- Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
- Rechargeable Battery: Included LB-012 lithium-ion battery charges in the camera over USB with the supplied adapter in about 2 hours; charge it for at least 4 hours before first use to maximize battery life
Or skip the browser setup
If you need a screenshot without running Selenium and a browser locally, ScreenshotNeo returns a screenshot or PDF from one GET request. Request JPEG output with the API’s format option; the example below shows the basic call and saves the response body as a file. See the ScreenshotNeo API documentation for request parameters and output options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up for 1,000 free screenshots a month—no card required.
Quick Recap
Troubleshooting
- The file has a .jpg name but will not open as JPEG: It may still contain Selenium’s PNG bytes. Decode with Pillow and save using
format="JPEG", rather than only changing the extension. - Pillow raises an error when saving: Ensure the image is converted to RGB, or composite onto an RGB background first if transparency matters.
- The JPEG looks softer or has artifacts: JPEG is lossy. Increase the quality setting or keep PNG when preserving fine detail and exact pixels is more important than file size.
- The background is not the color you expected: Choose a background explicitly by compositing the RGBA image before JPEG encoding.
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.

