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.

In Selenium’s Python bindings, changing the filename to .jpg does not convert a screenshot: the built-in screenshot file methods produce PNG. Capture the PNG bytes, open them with Pillow, convert the image to RGB, and explicitly save it as JPEG.

Convert a Selenium screenshot to JPEG in Python

Install Pillow if it is not already available in your environment:

python -m pip install Pillow

Then capture the screenshot and encode it as JPEG:

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 active Selenium WebDriver instance. get_screenshot_as_png() returns PNG data as bytes; BytesIO lets Pillow read those bytes without first writing a temporary file. The explicit format="JPEG" controls the encoding, while the filename extension makes the output format clear. Selenium documents its Python screenshot-to-file method as saving a PNG image (Selenium Python WebDriver API).

Choosing JPEG quality

The example uses quality 90 as a practical setting, not a universal standard. JPEG is lossy, so changing the quality trades file size against visible compression. Inspect the result for your own use case; screenshots with small text, crisp interface edges, or exact pixel requirements may look better as PNG.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Kodak PIXPRO FZ45 16MP Compact Digital Camera, 4X Optical Zoom, AA, Black
  • 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

Handling transparency

JPEG does not support an alpha channel. The example’s convert("RGB") removes transparency; if transparent pixels matter, composite the image onto a chosen background before saving so the result has the appearance you intend. Pillow documents conversion to RGB before JPEG saving and its support for reading image data from file-like objects (Pillow documentation).

Why renaming the screenshot does not work

Selenium’s Python save_screenshot() and get_screenshot_as_file() produce PNG output. Giving the output path a .jpg suffix does not change the encoded data. Use the bytes-and-Pillow conversion above, or save a correctly named PNG first, open that file with Pillow, and save a separate JPEG. The file-to-file approach uses an extra temporary file but has the same format and quality tradeoffs.

Rank #2
Sale
Kodak PIXPRO FZ55 16MP Compact Digital Camera, 5X Optical Zoom, Black
  • 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

Choose JPEG or keep PNG

Format Image fidelity Transparency Best fit
PNG Lossless Supported Sharp text, exact pixels, or images that need transparency
JPEG Lossy; quality setting affects the result Not supported When JPEG output is required and some compression is acceptable

If a downstream system specifically requires JPEG, convert explicitly. If fidelity or transparency matters more than JPEG compatibility, leave Selenium’s screenshot as PNG.

Other Selenium language bindings may differ

Do not assume Python’s file-output behavior applies to every Selenium binding. Selenium’s .NET documentation shows a screenshot saved with SaveAsFile("screenshot.png", ScreenshotImageFormat.Png) and lists format values including Jpeg. Check the API documentation for the language you use; format selection is binding-specific (Selenium screenshot documentation for .NET).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Digital Camera, Latest FHD 1080P Digital Camera for Teens with SD Card Anti Shake Point and Shoot Cameras Portable 16X Zoom Compact Small Cameras for Kids Boys Girls Seniors with Wrist Strap
  • 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.

Troubleshooting conversion problems

  • The saved file is PNG despite a .jpg name: The extension does not convert the bytes. Open the PNG data with Pillow and save with format="JPEG".
  • Pillow reports an unknown or unreadable image: Confirm that you pass the bytes returned by Selenium to Image.open(BytesIO(png_bytes)), and that the WebDriver screenshot call completed successfully.
  • Saving raises an error about the image mode: Convert the image to RGB before saving as JPEG, as in image.convert("RGB").save(..., format="JPEG").
  • Transparent areas look wrong: Decide on a background and composite onto it before converting; JPEG cannot preserve transparency.
  • Text or edges look degraded: JPEG compression is lossy. Increase the chosen quality setting or retain PNG if exact pixels and sharp detail are important.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a website image rather than a screenshot produced by your existing Selenium browser session, ScreenshotNeo can return PNG, JPEG, WebP, or PDF from a GET request. Its API can accept or remove cookie banners, popups, and chat widgets before capture; bot checks, blank pages, failed loads, and cache hits are not billed. It also offers an MCP server so AI agents can take screenshots. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

See the ScreenshotNeo API documentation for options. Example cURL request saving a JPEG:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -d format=jpeg -o shot.jpg

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Quick Recap

SaleBestseller No. 1
Kodak PIXPRO FZ45 16MP Compact Digital Camera, 4X Optical Zoom, AA, Black
Kodak PIXPRO FZ45 16MP Compact Digital Camera, 4X Optical Zoom, AA, Black
16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting; Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
$99.99
SaleBestseller No. 2
Kodak PIXPRO FZ55 16MP Compact Digital Camera, 5X Optical Zoom, Black
Kodak PIXPRO FZ55 16MP Compact Digital Camera, 5X Optical Zoom, Black
16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting; Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
$139.99
Bestseller No. 4
Kodak PIXPRO FZ55 16MP Compact Digital Camera, 5X Optical Zoom, Red
Kodak PIXPRO FZ55 16MP Compact Digital Camera, 5X Optical Zoom, Red
16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting; Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
$139.99
Rank #4
Kodak PIXPRO FZ55 16MP Compact Digital Camera, 5X Optical Zoom, Red
  • 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

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.

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