PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchSome links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
PHP cannot turn a webpage URL into a screenshot by calling imagewebp() alone: that function encodes an image that already exists. To capture a rendered page, use a browser such as Chrome or Chromium controlled from PHP, request WebP output, and save and verify the resulting bytes. If you do not want to install and operate a browser, a hosted screenshot API is another route.
What PHP needs to capture a webpage
A webpage screenshot has two separate jobs. First, a rendering engine loads the page’s HTML, CSS, fonts, and JavaScript and paints them into pixels. Second, an image encoder writes those pixels in a format such as WebP. PHP’s GD function imagewebp() performs the encoding job only; it does not navigate to a URL or render a webpage. The PHP manual describes it as a function that “Outputs or saves a WebP version of the given image.” (PHP imagewebp documentation.)
For an actual page capture, choose between running a browser that your PHP application controls and sending the URL to a managed capture service. In either case, decide whether you need the first viewport, the full page, or a particular element, and account for JavaScript-rendered content before saving the image.
Capture WebP with PHP and Chrome or Chromium
The chrome-php/chrome project documents taking screenshots in PNG, JPEG, or WebP, with quality options for JPEG or WebP and a full-page capture option. The example below shows the core package API; check the current package installation guide and the documentation for your installed version before using it, because the project and browser versions matter.
#1 Best Overall
- Convert pictures in to batch mode and export jpeg, png, jpg or other image format
- Photo size converter helps to compress and resize pictures in high quality
- Jpeg converter easily converters multiple pictures in to other image format
- Share images by reducing and compressing the image sizes by maintain quality
- Choose compress level and reduce the image size to easily share pictures
Install the browser and PHP library
Install Chrome or Chromium in the environment that runs your PHP application, then install and configure chrome-php/chrome by following its current project instructions. The PHP process needs permission to start or connect to the browser and write to the destination directory. A local development installation is not sufficient proof that the same browser executable, fonts, permissions, and runtime settings are available in production.
Open the page, wait, and save WebP bytes
The following illustrates the documented capture options and the expected save-and-check workflow. Adapt browser startup and connection setup to the installed package version and your deployment; do not treat this sketch as a drop-in guarantee across versions.
<?php
require __DIR__ . '/vendor/autoload.php';
use HeadlessChromiumBrowserFactory;
$url = 'https://example.com/';
$output = __DIR__ . '/page.webp';
$browserFactory = new BrowserFactory();
$browser = $browserFactory->createBrowser();
try {
$page = $browser->createPage();
$page->navigate($url)->waitForNavigation();
// Add a page-specific wait here if important content loads asynchronously.
$screenshot = $page->screenshot([
'format' => 'webp',
'quality' => 80,
'captureBeyondViewport' => true,
]);
$screenshot->saveToFile($output);
clearstatcache(true, $output);
if (!is_file($output) || filesize($output) === 0) {
throw new RuntimeException('Screenshot was not written or is empty.');
}
echo "Saved {$output} (" . filesize($output) . " bytes)n";
} finally {
$browser->close();
}
The browser startup and page navigation methods can differ by library version. Consult the chrome-php/chrome project documentation for the supported setup and screenshot options in the version you install. The project documents full-page clipping/capture; confirm the exact option name and behavior for that version rather than assuming captureBeyondViewport is universal. Its WebP quality setting is also package- and browser-dependent.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #2
- This app converts any image to PDF, PNG, JPG, WEBP, or BMP
- No WI-FI needed
- No ads
- No in-apps
- GDPR compliant
Choose the capture scope and timing
- Viewport: capture what a browser shows in its current viewport. Set the viewport to the dimensions your downstream use expects before capture.
- Full page: use the package’s documented full-page option when you need content below the fold. Very tall pages use more memory and can encounter browser or deployment limits.
- Dynamic pages: navigation completion does not necessarily mean a chart, image, or client-rendered component has finished. Wait for a page-specific selector or another reliable readiness condition before taking the screenshot.
- Quality: use a quality option only where the installed package supports it. A lower lossy quality can reduce file size while introducing visible artifacts; inspect output at its intended display size.
Verify the saved file
A successful method call is not enough to establish that the output is usable. Check that the file exists and is non-empty, then decode it with an independent image viewer or parser. Confirm it is actually WebP rather than merely a file with a .webp extension. If the page is blank or incomplete, check navigation, wait conditions, browser errors, and access to the target before changing the encoder settings.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. A GET request with a page URL can return WebP, PNG, JPEG, or PDF. For a PHP application, call the endpoint and save the response body:
<?php
$url = 'https://stripe.com';
$response = file_get_contents(
'https://api.screenshotneo.com/v1/shot?access_key=YOUR_API_KEY&url=' . rawurlencode($url)
);
if ($response === false) {
throw new RuntimeException('Screenshot request failed.');
}
file_put_contents(__DIR__ . '/shot.webp', $response);
For production use, handle HTTP errors and response headers explicitly, set a suitable request timeout, and keep the API key out of source control. See the ScreenshotNeo API documentation for request parameters and response details.
Rank #3
- -Simple and Easy to use.
- -You can convert image from JPG, GIF, JPEG, PNG, BMP, WBMP and WEBP into JPEG, PNG and WEBP.
- -Converts images with good quality.
- -Fast image converting.
- -More than 100 image convert
With ScreenshotNeo, cookie banners are accepted and more than 60 known consent platforms, newsletter popups, and chat widgets are removed before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsCreate a free ScreenshotNeo account to try the API.
Convert an existing image to WebP with GD
If another process has already rendered the page and provided an image that GD can decode, imagewebp() can encode that image as WebP. It is not a substitute for the browser capture step.
<?php
$input = __DIR__ . '/existing-image.png';
$output = __DIR__ . '/converted.webp';
$image = imagecreatefrompng($input);
if ($image === false) {
throw new RuntimeException('Could not decode the input image.');
}
try {
$ok = imagewebp($image, $output, 80);
} finally {
imagedestroy($image);
}
clearstatcache(true, $output);
if (!$ok || !is_file($output) || filesize($output) === 0) {
throw new RuntimeException('WebP output could not be verified.');
}
The current PHP manual gives the signature imagewebp(GdImage $image, resource|string|null $file = null, int $quality = -1). A destination can be a path or stream; omitting it emits image data directly. Quality 0 is lower quality and smaller output, 100 is higher quality and larger output, and -1 selects the documented default of 80. PHP 8 uses a GdImage object, and PHP 8.4 throws ValueError for an invalid quality value. The manual warns that imagewebp() may return true even if libgd fails to output the image, which is why the example checks the file and why decoding it independently is prudent. (PHP imagewebp documentation.)
Rank #4
- Compress Photos Without Quality Loss – Reduce image size in seconds while keeping excellent visual quality. Perfect for saving storage or preparing images for upload.
- Convert Between JPG, PNG & WEBP – Easily switch formats for better compatibility, faster sharing, and optimized storage.
- Create PDF from Images – Combine one or multiple photos into a clean, professional-looking PDF with just one tap.
- Batch Processing & Fast Performance – Compress or convert multiple images at once. Save time with smooth, quick processing.
- Offline, No Watermark & Easy Sharing – Works completely offline, adds no watermark, and lets you share directly via WhatsApp, Gmail, Drive, or any social app.
Check WebP support in the actual PHP runtime
GD’s capabilities depend on how PHP and its linked libgd were built. Check the runtime that will handle production requests, not only a developer laptop. For example, inspect gd_info() in the application environment and look for WebP support:
Free tools Windows power users keep installed
One-click scans. No signup required.
<?php
$info = gd_info();
var_dump($info['WebP Support'] ?? false);
PHP’s imagecreatefromstring() detects WebP input only if the GD build supports it; WebP support was added in PHP 7.3 when the linked libgd supports the format. imagecreatefromwebp() reads WebP files, but not animated WebP. See the imagecreatefromstring documentation and imagecreatefromwebp documentation.
Choose a capture approach for your application
The practical choice is between operating a browser yourself and outsourcing page capture to a service. These are different deployment models rather than competing encoders.
Best Value
- Compress images effortlessly
- Convert to popular formats like JPG, GIF, PNG, WEBP, HEIC
- Resize images
- Bulk Compress & Convert
- Save and View Exif Data
| Consideration | Self-managed browser | Hosted capture service |
|---|---|---|
| Infrastructure | You install, configure, and operate Chrome or Chromium alongside the PHP application. | The provider operates the rendering infrastructure; your application makes requests to it. |
| Control | You can choose and manage browser versions and page-loading behavior, subject to the package and browser APIs. | Capture options and browser behavior depend on the provider’s current service. |
| Operations | You are responsible for browser compatibility, process lifecycle, resource use, concurrency, and deployment permissions. | You depend on the provider’s availability, request limits, terms, and data-handling practices. |
| Cost and throughput | Infrastructure and maintenance costs depend on your environment and workload; no comparative benchmark is established here. | Pricing and request limits vary by provider and can change; verify current terms directly. |
| Observability | You can instrument browser processes and application logs, though you must build that operational visibility. | Use the provider’s documented response codes, headers, and usage reporting where available. |
ImageMagick can also encode WebP when it is already part of an image-processing pipeline, but it does not render a webpage. Its documentation lists a default WebP quality of 75 and encoding options; behavior may depend on its version and build. Keep browser rendering and image encoding as separate steps. (ImageMagick WebP documentation.)
Troubleshoot common failures
The output is blank or misses page content
- Cause: the page or its JavaScript-rendered sections were not ready when capture began.
- Fix: wait for navigation and then for a selector or page-specific readiness condition that corresponds to the content you need. Check whether the page requires authentication or blocks automated browsers.
The output is PNG or JPEG, not WebP
- Cause: the screenshot option was omitted, misspelled, or unsupported in the installed package/browser combination.
- Fix: verify the package version’s documented format values and inspect the output with a decoder. Do not infer format solely from the extension.
The file is missing, empty, or unreadable
- Cause: the PHP process lacks write permission, the capture failed before save, or the encoder did not produce valid bytes.
- Fix: log exceptions and browser errors, verify the destination directory and file size, then attempt independent decoding. For GD, do not rely on its boolean return value alone.
GD reports unsupported WebP or cannot open an input
- Cause: the production PHP build’s GD/libgd lacks the relevant WebP support, or the input is an animated WebP that
imagecreatefromwebp()cannot read. - Fix: check
gd_info()in the failing runtime, install or deploy a build with the required support, or use a suitable decoder for animated input.
Capture works locally but fails in deployment
- Cause: the server image may not contain the expected browser executable, fonts, libraries, permissions, or compatible package version.
- Fix: validate browser startup and capture inside the same container or host image used by the PHP application, and make browser/package versions explicit in deployment.
Full-page capture runs out of memory or takes too long
- Cause: very long pages, large images, complex scripts, or concurrent browser jobs can consume substantial resources.
- Fix: capture only the needed viewport or element, limit concurrency, set a bounded wait strategy, and test unusually long pages under the deployment’s actual resource limits.
Performance, reliability, and data considerations
Browser capture is heavier than encoding an existing image because it loads and executes a webpage. For a self-hosted browser, measure your own page mix and workload before choosing concurrency, timeouts, memory limits, or browser reuse behavior; no general performance figure applies to every page or server. Cache captures when freshness requirements permit, and use bounded waits rather than allowing slow pages to hold PHP workers indefinitely.
A hosted service can spare your team browser installation and maintenance, but it makes capture dependent on an external system. Before sending URLs or credentials, review its current privacy and data-handling terms, pricing, request limits, reliability commitments, and failure reporting. Do not assume the existence of a PHP client or WebP option establishes a particular service level.
Frequently Asked Questions
Does PHP GD take a screenshot of a URL?
No. GD encodes or decodes image data; a browser engine or screenshot service must first render the webpage.
Can PHP read animated WebP with imagecreatefromwebp()?
No. PHP’s documentation states that imagecreatefromwebp() cannot read animated WebP files.
Quick Recap
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.

