PHPackages                             ivoba/image-extractor - 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. ivoba/image-extractor

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

ivoba/image-extractor
=====================

Image Extractor

v1.0.0(11y ago)0631MITPHPPHP &gt;=5.4

Since Aug 28Pushed 11y ago1 watchersCompare

[ Source](https://github.com/ivoba/image-extractor)[ Packagist](https://packagist.org/packages/ivoba/image-extractor)[ Docs](https://github.com/ivoba/image-extractor)[ RSS](/packages/ivoba-image-extractor/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

Image Extractor
===============

[](#image-extractor)

[![Build Status](https://camo.githubusercontent.com/61c443fc80d3cb0c56cb8566b9565a2a7a2ebbc9f0ede4ae5694899b9837193d/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f69766f62612f696d6167652d657874726163746f722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/ivoba/image-extractor)[![Total Downloads](https://camo.githubusercontent.com/1be958fa1555b479088ce0b2ce2746bb12e85fa53361096ccb75c20d4057907b/68747470733a2f2f706f7365722e707567782e6f72672f69766f62612f696d6167652d657874726163746f722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/ivoba/image-extractor)

Extensible Image Extractor to find all Image tags in a string. The library uses the symfony DomCrawler as base of extraction.

- You can add multiple Extractors to find img tags or video tags to f.e resolve youtube thumbs. (or try the [Video Preview Image Extractor](https://github.com/ivoba/video-preview-image-extractor))
- You can add own XPath expressions to ImageXPathExtractor.
- You can define custom &amp; additional Extractors.
- You can add multiple Filter to filter the found Images.
- You can define custom Filter.
- You can resolve relative image pathes with a FixRelativePathFilter.

As extractor a ImageXPathExtractor gets shipped, which fetches all img tags.

These filters are provided:

- a StrPosFilter which filters images that contain one of the given filter strings.
- a FixRelativePathFilter that adds a basePath to all relative image paths.

Install
-------

[](#install)

Via Composer

```
{
    "require": {
        "ivoba/image-extractor": "dev-master"
    }
}
```

Usage
-----

[](#usage)

```
$extractorList = [new ImageXPathExtractor()];
$filter = [new StrPosFilter(['flattr-badge', 'feedburner.com']];
$imageExtractor = new ImageExtractor($extractorList, $filter);
$images = $imageExtractor->extract(file_get_contents($file));
```

A factory method for the default ImageExtractor with a default ImageXPathExtractor is provided:

```
    $imageCreator = ImageExtractor::create();
```

Testing
-------

[](#testing)

```
$ phpunit
```

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/ivoba/image-extractor/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- Ivo Bathke()

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/ivoba/image-extractor/blob/master/LICENSE) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

4281d ago

### Community

Maintainers

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

---

Top Contributors

[![ivoba](https://avatars.githubusercontent.com/u/471254?v=4)](https://github.com/ivoba "ivoba (12 commits)")

---

Tags

parserimageextractorscrapper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ivoba-image-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/ivoba-image-extractor/health.svg)](https://phpackages.com/packages/ivoba-image-extractor)
```

###  Alternatives

[intervention/image

PHP Image Processing

14.3k194.3M2.2k](/packages/intervention-image)[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[liip/imagine-bundle

This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.

1.7k38.3M217](/packages/liip-imagine-bundle)[spatie/image

Manipulate images with an expressive API

1.4k54.4M138](/packages/spatie-image)[brianmcdo/image-palette

Extracts colors from an image and generates a color palette against a whitelist of colors.

179209.0k2](/packages/brianmcdo-image-palette)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)

PHPackages © 2026

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