Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Image Convert to JPG, PNG & GIF using PHP

In this post I help you to convert any uploaded image to JPG, PNG and GIF.

Create a file image_converter.php.

In this code you see using convert_image() has three mandatory parameters like as:

$convert_type => accepts string either png,jpg or gif.
$target_dir => it is the source as well as the target directory
$image_name => give the actual image name such as image1.jpg.
$image_quality => can be adjusted, if you don’t want 100% quality.

Next, create index.php to Upload the image.

Then, create convert.php to convert the image. And make a folder in your directory name as uploads. Because when the image is uploaded or convert, the image will save on this folder.

And, create a download.php to downloads the converted image forcefully.

Then, Run the index.php and see the view.

After Upload the image.

After converted the image.

Then, you can download or convert another image.

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.