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(3y ago)312MITPHPPHP &gt;=7.4

Since May 22Pushed 3y 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 2w 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

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

1186d 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

[goat1000/svggraph

Generates SVG graphs

135931.0k3](/packages/goat1000-svggraph)[stefangabos/zebra_image

A single-file, lightweight PHP library designed for efficient image manipulation featuring methods for modifying images and applying filters

138121.6k7](/packages/stefangabos-zebra-image)[treinetic/imageartist

ImageArtist is a php gd Wrapper which makes Image manipulation insanely easy, we introduce ImageArtist as Photoshop for php

8783.2k](/packages/treinetic-imageartist)[johncarter/filament-focal-point-picker

An image focal point picker for Filament Admin.

4431.7k1](/packages/johncarter-filament-focal-point-picker)[yk/laravel-ocr

A wrapper for gocr.

1356.6k](/packages/yk-laravel-ocr)

PHPackages © 2026

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