PHPackages                             jukuan/img-to-web - 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. jukuan/img-to-web

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

jukuan/img-to-web
=================

Converts images to web-friendly format (or JPG, PNG)

1.0.1(2y ago)312MITPHPPHP &gt;=7.4

Since May 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jukuan/imgToWebp)[ Packagist](https://packagist.org/packages/jukuan/img-to-web)[ RSS](/packages/jukuan-img-to-web/feed)WikiDiscussions main Synced 1mo ago

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

imgToWebp
=========

[](#imgtowebp)

imgToWebp is a PHP library for converting images (JPG, PNG, WebP) to other formats (webp by default) and resizing them on the fly. It provides a modern alternative to the old TimThumb script file, allowing you to easily generate resized version of images in your PHP applications.

Features
--------

[](#features)

- Convert images to WebP, JPG, or PNG formats
- Resize images on the fly
- Efficient image processing using GD library
- Easy to use and integrate with existing PHP applications

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- GD extension of PHP

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

[](#installation)

You can imgToWebp by composer or
simply clone or download the repository and include files in your PHP application:

Usage
-----

[](#usage)

Check the test directory. There are few examples how to use ir. To use imgToWebp, simply create a new `imgToWebp` object and call the `convert()` method with the source and destination paths:

You can use the following PHP code

```
try {
    $imagePath = (new ImgConvertorService())
        ->setDirs($resizedImgDir, __DIR__)
        ->prepareImagePath();
    (new Response())->doImageOutput($imagePath);
} catch (\Exception $e) {
    // handle an error
}
```

Example for Laravel:

```
use Jukuan\ImgToWeb\Service\ImgConvertorService;
use Jukuan\ImgToWeb\Http\Response as ImgToWebResponse;

Route::get('img', function ()
{
    $sourceImgDir = public_path('');
    $resizedImgDir = public_path('resized');

    try {
        $imagePath = (new ImgConvertorService())
            ->setDirs($resizedImgDir, $sourceImgDir)
            ->prepareImagePath();
        (new ImgToWebResponse())->doImageOutput($imagePath);
    } catch (\Exception $e) {
        abort(404);
    }
});
```

In the URL you can specify additional options, such as the width, the height, the extension of output file: For example: `https://example.com/resizer/?img=static/uploads/guy.jpg&w=120`

Security Considerations
-----------------------

[](#security-considerations)

Please note that imgToWebp is provided "as is" without any guarantee, and it might be a bit dangerous to allow a PHP script to have write access to the directory. Use caution when using imgToWebp in production environments and ensure that your application has proper security measures in place.

License
-------

[](#license)

imgToWebp is licensed under the MIT License. See `LICENSE` for more information.

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

[](#contributing)

Contributions to imgToWebp are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request.

Credits
-------

[](#credits)

imgToWebp was created by \[Julian M.\]. The script is inspired by TimThumb library.

Contact
-------

[](#contact)

If you have any questions or feedback about imgToWebp, please contact us at \[i\[at\]juljan.by\].

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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 ~0 days

Total

2

Last Release

1086d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12e7d266366a86cf4dd1c761ad7c3c015a04cdb608bd911f9b5e3932389f0c99?d=identicon)[jukuan](/maintainers/jukuan)

---

Top Contributors

[![jukuan](https://avatars.githubusercontent.com/u/3403924?v=4)](https://github.com/jukuan "jukuan (7 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jukuan-img-to-web/health.svg)

```
[![Health](https://phpackages.com/badges/jukuan-img-to-web/health.svg)](https://phpackages.com/packages/jukuan-img-to-web)
```

###  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)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[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)

PHPackages © 2026

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