ScreenshotNeo

BlogHow-to

How to Resize ShrinkTheWeb Screenshots Without Changing the Page Viewport

Change ShrinkTheWeb’s screenshot output size while keeping the browser viewport—and the page’s responsive layout—unchanged.

By the ScreenshotNeo team4 October 20265 min read

To resize a ShrinkTheWeb screenshot without changing how the page lays out, change the screenshot output settings and leave the browser viewport settings alone. In the Drupal 8 integration guide, custom_width controls output width and max_height sets the height to crop. native_resolution and widescreen_resolution_y set the browser viewport width and height. The ShrinkTheWeb Drupal 8 integration guide is dated March 4, 2019, so confirm that these names and behaviors still apply to your current account and API before relying on them.

1. Keep output dimensions separate from the viewport

The viewport determines the dimensions of the browser area used to render a page. Changing it can change responsive behavior: a page might switch from a desktop layout to a tablet or mobile layout. Output sizing concerns the resulting screenshot image or crop. For the task in this guide, change only the output-size option and preserve the viewport values.

Goal Drupal integration parameter Documented meaning
Set screenshot output width custom_width Custom output width
Limit or crop screenshot height max_height Height to crop the image
Set browser viewport width native_resolution Browser resolution or viewport width
Set browser viewport height widescreen_resolution_y Browser resolution or viewport height

These names and descriptions come from the integration guide, not verified current vendor API documentation. The guide does not specify whether resizing preserves aspect ratio, whether images can be upscaled, or how output cropping interacts with full-page capture. Treat those details as account- and implementation-specific until confirmed.

2. Configure one Drupal capture

The guide distinguishes global settings used by basic Drupal field formatter usage from advanced per-request options, which can customize an individual capture. For one request, keep the existing viewport values and set the output values you need. The guide gives this illustrative combination:

$options = array(
  'custom_width' => 600,
  'max_height' => 320,
  'native_resolution' => 1020,
  'widescreen_resolution_y' => 760,
);

Here, the output width is set to 600 and the crop height to 320, while the browser viewport remains 1020 by 760. These are examples from the guide, not universal recommended dimensions. Adapt the request structure to the Drupal module version and capture code in your installation; the guide’s array is not a standalone API request.

  1. Find the current viewport settings for the capture. Record both width and height.
  2. Change only custom_width and, if needed, max_height in the per-request options.
  3. Leave native_resolution and widescreen_resolution_y unchanged.
  4. Capture a test page with a breakpoint-sensitive layout and check both the layout and returned image dimensions.
  5. If the parameters are rejected or behave differently, consult current ShrinkTheWeb documentation or support for your account and integration version.

3. Choose output dimensions carefully

Output width

Use custom_width when you want to change the delivered image width while preserving the browser viewport. The 2019 integration guide does not establish whether a smaller output is achieved by resampling, cropping, or another process. Compare the returned dimensions and page content rather than assuming a particular resizing algorithm.

Crop height

The guide describes max_height as the height to crop. It does not establish whether this means a maximum output height in all modes, where the crop begins, or whether content beyond the crop is discarded. If you need the whole page, verify how the current integration handles full-page capture and this setting together before using it.

Viewport dimensions

Keep native_resolution and widescreen_resolution_y at the values used for the desired responsive layout. Changing either can affect which breakpoints apply, how wide content appears, and which elements are visible. To resize the returned file only, these are not the controls to adjust.

4. Global settings versus a per-request override

According to the Drupal 8 guide, basic usage and field formatters take global settings, which affect screenshot occurrences broadly. Its advanced PHP example permits an individual request array to be customized. Use a per-request configuration when only one capture needs different output dimensions; use global settings only when the same change is intended for every relevant capture.

The guide also says some features may require an account upgrade. It does not establish current plan entitlements or which account level is needed for these options. Check the current vendor documentation or your account rather than assuming a particular feature is available.

5. Troubleshooting

Symptom Likely cause What to check
The page switches to a different layout A viewport value changed along with the output size. Restore the original native_resolution and widescreen_resolution_y; change only output options.
The returned image width did not change The option may not be applied by the installed module version, may be ignored in that request path, or may require account access. Confirm the per-request options are actually passed to the capture, then check current integration and account documentation.
The screenshot is shorter than expected max_height is documented as a crop height. Try an appropriate crop limit or omit it if supported and the full page is required; verify current behavior with the vendor.
An option is rejected or has no effect The guide is from 2019 and may not describe current parameter names or compatibility. Check current ShrinkTheWeb documentation and the version of the Drupal integration in use.
A feature is unavailable The guide notes that some API features may require an account upgrade. Check the current account entitlements; the guide does not identify present-day plan requirements.

6. Performance, reliability, and cost considerations

Changing output dimensions while preserving the viewport helps keep the rendered responsive layout consistent across captures. It does not, by itself, establish how quickly a capture runs or what image-processing method the service uses. If the page is tall or dynamic, confirm crop and full-page behavior with representative pages before relying on the resulting files.

The source material does not provide current ShrinkTheWeb pricing, limits, reliability figures, or a performance benchmark. It also does not verify the current availability of these settings. Check the vendor’s current documentation and your account for those details.

7. Or skip the browser setup

If you want a screenshot API call without configuring a browser integration, ScreenshotNeo accepts a URL and returns a screenshot or PDF. See the ScreenshotNeo API documentation for supported options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before the shot. Bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, with no card.

8. Frequently asked questions

Will changing the output width preserve the page’s responsive layout?

It should preserve the viewport-driven layout if the viewport settings stay fixed. The 2019 guide does not document every current rendering detail, so verify the result with your integration.

Are the example values suitable for every site?

No. The values 600, 320, 1020, and 760 are an example from the guide. Choose dimensions for your own output needs and intended viewport.

Does the documentation confirm current ShrinkTheWeb support for these options?

No. The source is a Drupal integration guide last updated in 2019. Confirm current compatibility and account availability with the vendor.