Laravel 7 create and upload Grayscale Image with example

Laravel 7 create and upload Grayscale Image with example

In this tutorial, we will show to you how to create and upload Grayscale Image with example in laravel 7. If you want to create a greyscale image from an original image in your laravel application then you can create using “intervention/image” package.

We will also explain in laravel 7 create and upload grayscale image with example. so you can also learn and use of laravel intervention image package.

So let’s start the creation of a greyscale image with the following steps.

Overview

Step 1: Install Laravel

Step 2: Install intervention/image Package

Step 3: Add providers and aliases

Step 4: Create Route

Step 5: Create a Controller

Step 6: Create Blade Files

Step 7: Run Our Laravel Application

Step 1: Install Laravel

We are going to install laravel 7, so first open the command prompt or terminal and go to go to xampp htdocs folder directory using the command prompt. after then run the below command.

Step 2: Install intervention/image Package

Now, We will install intervention/image package using below command.

Step 3: Add providers and aliases

We will add below providers and aliases in the “config/app.php” file.

Step 4: Create Route

Add the following route code in the “routes/web.php” file.

Step 5: Create a Controller

Here below command help to create the controller and model.

ImageController.php

Step 6: Create Blade Files

Finally, We will create viewGrayscaleImage.blade.php file in the “resources/views/” folder directory and paste below code.

viewGrayscaleImage.blade.php

Step 7: Run Our Laravel Application
We can start the server and run this example using the below command.

Now we will run our example using the below Url in the browser.