PHPackages                             lexinzector/picture - 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. lexinzector/picture

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

lexinzector/picture
===================

Library for working with images (cropping and reducing, converting to base64, etc.)

1.0(2y ago)010MITPHPPHP &gt;=5.6.0

Since Oct 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lexinzector/picture)[ Packagist](https://packagist.org/packages/lexinzector/picture)[ RSS](/packages/lexinzector-picture/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Picture
=======

[](#picture)

Library for working with images (cropping and reducing, converting to base64, etc.)

Possibilities
-------------

[](#possibilities)

- proportionally reduce the image size in width or height
- reduce the image by percentage
- fit the image into a frame of a certain size
- arbitrary image resizing
- change image quality
- output the generated image without saving
- saving the image on the server
- assigning access rights to the image

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

[](#requirements)

PHP &gt;= 5.6.0

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

[](#installation)

run in console:

```
composer require lexinzector/picture

```

Example
-------

[](#example)

```
use \Lexinzector\Picture\Picture;

// resize the image proportionally and save it on the server without changing the file extension
// the resulting image will not exceed 400 pixels in height and 300 in width
// that is, it will automatically fit into the required dimensions
$new_image = new Picture('url or path to file');
$new_image->autoimageresize(300, 400);
$new_image->imagesave($new_image->image_type, 'folder on the server');
$new_image->imageout();

// output to the screen without changing the file extension
$new_image = new Picture('url or path to file');
$new_image->autoimageresize(300, 400);
$new_image->imagesave($new_image->image_type, null);
$new_image->imageout();

// save on the server and select the output file type
$new_image = new Picture('url or path to file');
$new_image->autoimageresize(300, 400);
$new_image->imagesave('png', 'folder on the server');
$new_image->imageout();

// compress the file and display it on the screen
$new_image = new Picture('url or path to file');
$new_image->autoimageresize(300, 400);
$new_image->imagesave('jpeg', null, 75);
$new_image->imageout();

// save on the server, compress and set access rights
$new_image = new Picture('url or path to file');
$new_image->autoimageresize(300, 400);
$new_image->imagesave('jpeg', 'folder on the server', 75, 0777);
$new_image->imageout();

// reduce the image width
$new_image = new Picture('url or path to file');
$new_image->imageresizewidth(300);
$new_image->imagesave($new_image->image_type, 'folder on the server');
$new_image->imageout();

// reduce the image height
$new_image = new Picture('url or path to file');
$new_image->imageresizeheight(400);
$new_image->imagesave($new_image->image_type, 'folder on the server');
$new_image->imageout();

// arbitrarily reduce the image without maintaining the proportions
$new_image = new Picture('url or path to file');
$new_image->imageresize(300, 400);
$new_image->imagesave($new_image->image_type, 'folder on the server');
$new_image->imageout();

// reduce the image by percentage
$new_image = new Picture('url or path to file');
$new_image->percentimagereduce(30);
$new_image->imagesave($new_image->image_type, 'folder on the server');
$new_image->imageout();

// reduce the image without maintaining the proportions without saving the image on disk for output in base64 format
$new_image = new Picture('url or path to file');
$new_image->imageresize(300, 400);
$new_image->imagesave($new_image->image_type, 'out');
$new_image->imageout();
$dataUri = "data:image/jpeg;base64,".base64_encode($new_image->image_contents);
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

940d ago

### Community

Maintainers

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

---

Top Contributors

[![lexinzector](https://avatars.githubusercontent.com/u/10235341?v=4)](https://github.com/lexinzector "lexinzector (5 commits)")

---

Tags

imagepicture

### Embed Badge

![Health badge](/badges/lexinzector-picture/health.svg)

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

###  Alternatives

[multiavatar/multiavatar-php

Multicultural Avatar Generator

653150.0k4](/packages/multiavatar-multiavatar-php)[sitegeist/sms-responsive-images

Provides ViewHelpers and configuration to render valid responsive images based on TYPO3's image cropping tool.

34493.1k2](/packages/sitegeist-sms-responsive-images)[spacecatninja/imager-x

Ninja powered image transforms.

29390.0k23](/packages/spacecatninja-imager-x)[dantsu/php-image-editor

PHP library to easily edit image with GD extension.

34152.1k2](/packages/dantsu-php-image-editor)[toinekamps/responsive-pics

Responsive Pics is a Wordpress tool for resizing images on the fly.

831.2k](/packages/toinekamps-responsive-pics)[visuellverstehen/statamic-picturesque

A Statamic tag for building HTML-only responsive images.

1016.9k](/packages/visuellverstehen-statamic-picturesque)

PHPackages © 2026

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