PHPackages                             jouwweb/reverse-image-cover - 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. jouwweb/reverse-image-cover

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

jouwweb/reverse-image-cover
===========================

Compute visible part of source image when covered in viewport

0.3.1(7y ago)0830MITPHPPHP &gt;=5.4

Since Aug 12Pushed 7y ago2 watchersCompare

[ Source](https://github.com/JouwWeb/reverse-image-cover)[ Packagist](https://packagist.org/packages/jouwweb/reverse-image-cover)[ RSS](/packages/jouwweb-reverse-image-cover/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (1)Versions (5)Used By (0)

Reverse Image Cover
===================

[](#reverse-image-cover)

Small library that can compute the part of the source image that is shown when it is being projected onto an element as background.

Can be used for example to reduce bandwidth by preprocessing the image so that only the crop is returned. The end result will be identical to the viewer.

Currently only supports backgrounds that *cover* the image and use percentages to position the image.

Usage
-----

[](#usage)

```
$viewport = new BackgroundCoverViewport(
  $viewportWidth,
  $viewportHeigt,
  $backgroundPositionX,
  $backgroundPositionY
);

$crop = $viewport->computeUsedCrop(
  $imageWidth,
  $imageHeight
);

echo "Visible part of image starts at({$crop[0]}, {$crop[1]}) ";
echo "and has a dimension of {$crop[2]} x {$crop[3]}";
```

Tests
-----

[](#tests)

Tests can be ran by:

1. `composer install`
2. `vendor/bin/phpunit`

The test suite can be visualized as follows:

1. Run server `php -S localhost:8080`
2. Visit [http://localhost:8080/tests/demo.php`](http://localhost:8080/tests/demo.php%60)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~454 days

Total

4

Last Release

2564d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/01a3e1034b26bd108985705a0e5292850bf1ee7d234d4676c8735d6feeebf85f?d=identicon)[koenkivits](/maintainers/koenkivits)

---

Top Contributors

[![villermen](https://avatars.githubusercontent.com/u/1106303?v=4)](https://github.com/villermen "villermen (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jouwweb-reverse-image-cover/health.svg)

```
[![Health](https://phpackages.com/badges/jouwweb-reverse-image-cover/health.svg)](https://phpackages.com/packages/jouwweb-reverse-image-cover)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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