Achieve better

Load speed & SEO score

MegaOptim is best in class image compression service carefully engineered that uses advanced compression algorithms to achieve state of the art cloud image compression service.

Optimize your images and benefit of faster load times, less disk space and bandwith usage while also boosting your SEO scores.

Original Image Original
Optimized Image Optimized

Before: 306.79 KB

After: 85.29 KB

Saved: 72%

MegaOptim is packed with bunch of features and can be easily integrated in any app.

300 free tokens per month

Three compression levels

Keep/Remove EXIF Data

Resize to max dimensions

Convert CMYK to RGB

WordPress Plugin

PHP, Python, Node.js libraries

CLI Tool

Windows, Linux, OSX Support

Detailed Statistics

Single key multiple sites

24/7 Support

WordPress Plugin

Our WordPress plugin integrates with our API and allows you to easily optimize images in your Media Library, NextGen Gallery, any custom folders or other gallery plugins.

The plugin supports all common image formats such as JPEG, PNG, GIF (animated or non-animated)


Read more

Three different compression levels

Supports the three different compression levels: ultra, intelligent and lossless.

Backup & Restore options

Options to automatically backup image, restore if backup available or delete specific backups

Thumbnail optimization support

WordPress creates thumbnails for each full size image. You can choose which thumbnail versions to be optimized!

Retina support

Seamlessly integrates with WP Retina 2x and auto optimizes your retina images and thumbnails.

Supports many other plugins

Integrates with different gallery plugins(NextGen, MediaPress, Envira, Foo Gallery, Robo Gallery), CloudFlare, WP Offload S3, WP Stateless, etc.

Developer tools

Our main goal is to make MegaOptim available to developers as much as possible. We developed few tools so far to integrate with some popular languages/frameworks.

Make sure you install you have installed MegaOptim PHP library via composer.

use MegaOptim\Optimizer;

$megaoptim = new Optimizer('your-api-key');

$resources = array(
    '/path/to/file1.jpg',
    '/path/to/file2.jpg',
);

$params = array( 'compression' => Optimizer::INTELLIGENT );
$response = $megaoptim->run( $resources, $params );

if( $response->isSuccessful() ) {
    foreach($response->getOptimizedFiles() as $file) {
        $file->saveAsFile('path/to/optimized-file.jpg');
    }
} else {
    foreach($response->getErrors() as $error) {
        echo $error;
    }
}
                            

First make sure you install you have installed python and pip and then run pip install megaoptim to install

import json
import os

from megaoptim import Client

# Init MegaOptim API client
api = Client("_YOUR_API_KEY_")
try:
# Pick up local path of the file
files = (
        os.path.dirname(os.path.abspath(__file__)) + os.sep + 'images' + os.sep + '1.png',
        os.path.dirname(os.path.abspath(__file__)) + os.sep + 'images' + os.sep + '2.png',
)
# Init empty params, will default to keep_exif=1, cmyktorgb=1, compression=lossy, max_height=0, max_width=0
params = dict()
# Optimize the file
r = api.optimize(files, params, 300)
if r.get('status') == 'ok' and r.get('code') == 200:
    for item in r.get('result'):
        print('Success: ' + str(item['success']))
        print('Original Size: ' + str(item['original_size']))
        print('Saved Percent: ' + str(item['saved_percent']))
        print('Saved Bytes: ' + str(item['saved_bytes']))
        print('Optimized Size: ' + str(item['optimized_size']))
        print('Download Url: ' + str(item['url']))
else:
    errors = r.get('errors')
    for error in errors:
        print(error)
except Exception as e:
template = "An exception of type {0} occurred. Arguments:\n{1!r}"
message = template.format(type(e).__name__, e.args)
print (message)
        
var MegaOptim = require('megaoptim');

var client = new MegaOptim({
api_key: '_YOUR_API_KEY_'
});

// Up to 5
var source = ['/path/to/file1.jpg', '/path/to/file2.jpg', '/path/to/file3.jpg'];

client.optimize(source, {}, 300, function (response) {
if (response.status === 'processing') {
    // Still processing.
    // If callback_url has been passed the status will be processing
    // So you should handle the processing in your callback url.
} else if (response.status === 'ok') {
    // Processing finished!
    // Results are there
    for (var i in response.result) {
        if (response.result.hasOwnProperty(i)) {
            console.log('Total saved: ' + response.result[i].saved_percent + '%');
            console.log('Download url: ' + response.result[i].url)
        }
    }
} else if (response.status === 'error') {
    // If error happened you have an errors array with all the errors.
    for (var i in response.errors) {
        if (response.errors.hasOwnProperty(i)) {
            // Print errors or do something!
            console.log(response.errors[i])
        }
    }
} else {
    // Unexpected error
}
});

                        

Make sure you install you have installed python and pip and then run pip install megaoptim to install.

cd directory
megaoptim --api-key YOUR-API-KEY --dir . --compression intelligent