PHP Classes

PHP lib for PunyPNG API: Compress images using the PunyPNG Web service

Recommend this page to a friend!
  Info   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-11 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 354 All time: 6,965 This week: 68Up
Version License PHP version Categories
php-puny-png 1.0.0GNU General Publi...5.0PHP 5, Graphics, Web services, Compre...


This class can compress images using the PunyPNG Web service.

It can send HTTP requests to upload one or more image files to the PunyPNG Web services API Web server so it can compress the images that were sent.

The class can also download the images compressed with the PunyPNG individually or in a group in a .ZIP archive.

The downloaded images are stored in a configurable download directory.

Innovation Award
PHP Programming Innovation award nominee
August 2012
Number 6

Prize: One book of choice by Packt
The speed of loading Web pages depends on many factors, including the speed of loading external page elements like for instance any images to be displayed on the page.

Smaller image files take less time to download and display.

This class helps minimizing the size of PNG images by calling the PunyPNG service to improve the compression factor of images in that format.

Manuel Lemos
Picture of Mark Rolich
  Performance   Level  
Name: Mark Rolich <contact>
Classes: 8 packages by
Country: Armenia Armenia
Age: 43
All time rank: 9051 in Armenia Armenia
Week rank: 95 Up1 in Armenia Armenia Equal
Innovation award
Innovation award
Nominee: 2x


PHP library for image compression, uses API <> Supports PNG, JPEG and GIF images Works on local files and urls Can be used in single file and batch modes More info on PunyPNG API <> Copyright (C) 2012 Mark Rolich

  Files folder image Files  
File Role Description
Files folder imagecompressed (1 file)
Files folder imagefiles (3 files)
Accessible without login Plain text file example.php Example non-batch mode example
Accessible without login Plain text file example_batch.php Example batch mode example
Accessible without login Plain text file license.txt Lic. LICENSE
Plain text file PunyPNG.php Class Main class
Accessible without login Plain text file README Data README

  Files folder image Files  /  compressed  
File Role Description
  Accessible without login Plain text file .gitignore Data example directory to store compressed files

  Files folder image Files  /  files  
File Role Description
  Accessible without login Image file img1.png Data example image
  Accessible without login Image file img2.jpg Data example image
  Accessible without login Image file img3.gif Data example image

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,965
This week:68Up
User Comments (1)
This is a very good class ;-)
11 years ago (Josť Filipe Lopes Santos)