PHPackages                             secomapp/browsershot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. secomapp/browsershot

ActiveLibrary[Image &amp; Media](/categories/media)

secomapp/browsershot
====================

Convert a webpage to an image from spatie

1.2.5(10y ago)091MITPHPPHP &gt;=5.4.0

Since May 2Pushed 10y ago2 watchersCompare

[ Source](https://github.com/secomapp/browsershot)[ Packagist](https://packagist.org/packages/secomapp/browsershot)[ Docs](https://github.com/secomapp/browsershot)[ RSS](/packages/secomapp-browsershot/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (14)Used By (0)

Convert a webpage to an image
=============================

[](#convert-a-webpage-to-an-image)

[![Latest Version](https://camo.githubusercontent.com/75305e58f66561b3701658b8899f040d309c704922fd28ebd687d15612523fa6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7370617469652f62726f7773657273686f742e7376673f7374796c653d666c61742d737175617265)](https://github.com/spatie/browsershot/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/72cae94fee18f9459062f85a75e08fc0511fb1d0818040094b21c3f67d310f4b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370617469652f62726f7773657273686f742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/spatie/browsershot)[![Total Downloads](https://camo.githubusercontent.com/79c514091011985df8233d43398e4008deffa00e65f79b2de2c51a2d26c15458/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f62726f7773657273686f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/browsershot)

The package can convert a webpage to an image. To accomplish this conversion [Phantomjs](http://phantomjs.org/) (included in the project) is used.

This package is used to generate the sitepreviews on the homepage of [spatie.be](https://spatie.be). It is also used by [Gordon Murray](https://twitter.com/murrion) to [add previews to shared content](http://www.murrion.com/2015/02/how-i-automate-sharing-content-to-linkedin-using-ayliens-content-analysis-api-and-browsershot/).

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Installation
------------

[](#installation)

This package can be installed through Composer.

```
composer require secomapp/browsershot
```

When using Laravel there is a service provider that you can make use of.

```
// app/config/app.php

'providers' => [
    '...',
    'Spatie\Browsershot\BrowsershotServiceProvider'
];
```

Please note that the provided binary is intented for use on Ubuntu.

Usage
-----

[](#usage)

Here is a sample call to create an image of a webpage:

```
    $browsershot = new Spatie\Browsershot\Browsershot();
    $browsershot
        ->setURL('http://www.arstechnica.com')
        ->setWidth('1024')
        ->setHeight('768')
        ->save('targetdirectory/arstechnica-browsershot.jpg');
```

These methods are provided:

- `setBinPath()`: Specify the path to your own phantomjs-binary.
- `setWidth()`: Set the width of the image (defaults to 640).
- `setHeight()`: Set the height of the image (defaults to 480).
- `setHeightToRenderWholePage()`: Calling this method will result in the entire webpage being rendered.
- `setURL()`: Set the URL of the webpage which should be converted to an image
- `save($targetFile)`: Starts the conversion-process. The targetfile should have one of these extensions: png, jpg, jpeg.

Other implementations
---------------------

[](#other-implementations)

- [Node.js](https://github.com/brenden/node-webshot)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

About Spatie
------------

[](#about-spatie)

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Total

12

Last Release

3834d ago

Major Versions

0.1.3 → 1.0.02015-01-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/e791638d7ba5a452d04f17d0e9d818724eb5a6d3297134c4761fafb70c3dd010?d=identicon)[cuongnhc](/maintainers/cuongnhc)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (42 commits)")[![cuongnhc](https://avatars.githubusercontent.com/u/298001?v=4)](https://github.com/cuongnhc "cuongnhc (5 commits)")[![JamesPlayer](https://avatars.githubusercontent.com/u/5218648?v=4)](https://github.com/JamesPlayer "JamesPlayer (1 commits)")[![martendej](https://avatars.githubusercontent.com/u/9840109?v=4)](https://github.com/martendej "martendej (1 commits)")

---

Tags

browserlaravelconvertimagewebpagescreenshotphantomjs

### Embed Badge

![Health badge](/badges/secomapp-browsershot/health.svg)

```
[![Health](https://phpackages.com/badges/secomapp-browsershot/health.svg)](https://phpackages.com/packages/secomapp-browsershot)
```

###  Alternatives

[urlbox/screenshots

Use urlbox to easily generate website thumbnail screenshots from a URL

14250.4k](/packages/urlbox-screenshots)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[danihidayatx/image-optimizer

Optimize your Filament images before they reach your database. Forked from joshembling/image-optimizer for Filament v4 &amp; v5 support.

254.4k](/packages/danihidayatx-image-optimizer)[reliqarts/laravel-guided-image

Simplified and ready image manipulation for Laravel via intervention image.

351.4k](/packages/reliqarts-laravel-guided-image)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
