PHPackages                             scrapify-dev/image-tool - 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. scrapify-dev/image-tool

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

scrapify-dev/image-tool
=======================

Laravel package for image tools like Compress, Resize, Rotate.

v1.0.0(9mo ago)01PHPPHP ^8.2

Since Aug 6Pushed 9mo agoCompare

[ Source](https://github.com/HenaAndhariya17/image-tools)[ Packagist](https://packagist.org/packages/scrapify-dev/image-tool)[ RSS](/packages/scrapify-dev-image-tool/feed)WikiDiscussions main Synced 1mo ago

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

📸 Scrapify Image Tools Library

A Laravel package for powerful **image processing** including compression, conversion, cropping, resizing, rotation, HTML-to-image conversion, upscaling, background removal (remove.bg API), and OCR (image-to-text).

This library wraps several industry-standard packages into an easy-to-use Laravel API.

---

📦 Installation
--------------

[](#-installation)

```
composer require scrapify-dev/image-tools
```

---

⚙️ Requirements
---------------

[](#️-requirements)

- **PHP:** `^8.2`
- **Laravel:** `^9.0` | `^10.0` | `^11.0` | `^12.0`
- **Dependencies:**

    - `intervention/image:^3.0`
    - `barryvdh/laravel-dompdf:^3.1`
    - `spatie/browsershot:^5.0`
    - `spatie/pdf-to-image:^1.2`
    - `thiagoalessio/tesseract_ocr:^2.13`
    - `illuminate/support` *(as per Laravel version)*

---

🚀 Quick Start
-------------

[](#-quick-start)

```
use Scrapify\ImageTools\CompressImage;

$compressor = new CompressImage();
$result = $compressor->compress($request->file('image_file'));

return response()->json([
    'filename' => $result['filename'],
    'url'      => $result['url'],
    'size_kb'  => round($result['size'] / 1024, 2),
]);
```

---

📑 Table of Contents
-------------------

[](#-table-of-contents)

1. [Compress Image](#1-compress-image)
2. [Convert Image](#2-convert-image)
3. [Crop Image](#3-crop-image)
4. [Resize Image](#4-resize-image)
5. [Rotate Image](#5-rotate-image)
6. [HTML to Image](#6-html-to-image)
7. [Upscale Image](#7-upscale-image)
8. [Remove Background](#8-remove-background)
9. [Image to Text (OCR)](#9-image-to-text)

---

1️⃣ Compress Image
------------------

[](#1️⃣-compress-image)

Reduces file size with minimal quality loss. PNGs are auto-converted to JPG for better compression.

```
use Scrapify\ImageTools\CompressImage;

$compressor = new CompressImage();
$result = $compressor->compress($request->file('image_file'));
```

---

2️⃣ Convert Image
-----------------

[](#2️⃣-convert-image)

Supported formats: `jpg`, `png`, `gif`, `webp`, `avif`, `pdf`

```
use Scrapify\ImageTools\ConvertImage;

$converter = new ConvertImage();
$result = $converter->convert($request->file('image_file'), 'webp');
```

---

3️⃣ Crop Image
--------------

[](#3️⃣-crop-image)

```
use Scrapify\ImageTools\CropImage;

$cropper = new CropImage();
$result = $cropper->crop($file, [
    'x' => 100,
    'y' => 50,
    'width' => 200,
    'height' => 150
]);
```

---

4️⃣ Resize Image
----------------

[](#4️⃣-resize-image)

```
use Scrapify\ImageTools\ResizeImage;

$resizer = new ResizeImage();
$result = $resizer->resize($file, 500, 300);
```

---

5️⃣ Rotate Image
----------------

[](#5️⃣-rotate-image)

```
use Scrapify\ImageTools\RotateImage;

$rotator = new RotateImage();
$result = $rotator->rotate($file, 90);
```

---

6️⃣ HTML to Image
-----------------

[](#6️⃣-html-to-image)

Converts a live HTML page or URL to an image using **ScreenshotLayer API** (no Puppeteer required).

```
use Scrapify\ImageTools\HtmlToImage;

$htmlToImage = new HtmlToImage();
$result = $htmlToImage->convert('https://example.com', 'png');

if ($result['success']) {
    echo "Image saved at: " . $result['url'];
}
```

**Example Class Implementation:**

```
private $apiKey = 'YOUR_SCREENSHOTLAYER_API_KEY';
```

Make sure to replace with your actual API key.

---

7️⃣ Upscale Image
-----------------

[](#7️⃣-upscale-image)

```
use Scrapify\ImageTools\UpscaleImage;

$upscaler = new UpscaleImage();
$result = $upscaler->upscale($file, 2.0);
```

---

8️⃣ Remove Background (remove.bg API)
-------------------------------------

[](#8️⃣-remove-background-removebg-api)

Removes the background of an image using the **remove.bg API**.

```
use Scrapify\ImageTools\RemoveBG;

$removeBG = new RemoveBG();
$result = $removeBG->remove($request->file('image_file'));
```

**Example Class Implementation:**

```
$apiKey = 'YOUR_REMOVE_BG_API_KEY';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.remove.bg/v1.0/removebg");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);

$postFields = [
    'image_file' => new \CURLFile(
        $imageFile->getRealPath(),
        $imageFile->getMimeType(),
        $imageFile->getClientOriginalName()
    ),
    'size' => 'auto',
];

curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "X-Api-Key: $apiKey"
]);

$result = curl_exec($ch);

if (curl_errno($ch)) {
    throw new Exception("cURL error: " . curl_error($ch));
}

curl_close($ch);
```

---

9️⃣ Image to Text (OCR)
-----------------------

[](#9️⃣-image-to-text-ocr)

Extracts text from an image using [`thiagoalessio/tesseract_ocr`](https://github.com/thiagoalessio/tesseract-ocr-for-php). No need to install Tesseract manually — it runs directly from PHP.

```
use Scrapify\ImageTools\ImageToText;

$imageTool = new ImageToText($file);
$text = $imageTool->process();
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance57

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

286d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f9ae840f4b060d80152376903886f7b47b0921cc96937182947d478378fc918?d=identicon)[HenaAndhariya17](/maintainers/HenaAndhariya17)

---

Top Contributors

[![HenaAndhariya17](https://avatars.githubusercontent.com/u/137869374?v=4)](https://github.com/HenaAndhariya17 "HenaAndhariya17 (3 commits)")

### Embed Badge

![Health badge](/badges/scrapify-dev-image-tool/health.svg)

```
[![Health](https://phpackages.com/badges/scrapify-dev-image-tool/health.svg)](https://phpackages.com/packages/scrapify-dev-image-tool)
```

###  Alternatives

[intervention/image-laravel

Laravel Integration of Intervention Image

1536.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[devfactory/imagecache

Laravel package for generating thumbnails of images and caching them in your public files folder.

1620.3k](/packages/devfactory-imagecache)[flowframe/laravel-drift

128.7k](/packages/flowframe-laravel-drift)

PHPackages © 2026

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