State of the art
image optimization

MegaOptim is image optimization service and WordPress plguin carefully engineered that combines several advanced techniques to achieve state of the art image optimization.

Optimizes all your images to increase page speed, reduce disk space usage and bandwith usage while also boosting your SEO at the lowest possible cost.

MegaOptim comes with 500 image tokens for FREE every month.

Original Image Original
Optimized Image Optimized

Before: 306.79KB

After: 85.29KB

Saved: 72.2%

Image Optimization done right

Improve your website page load speed by optimizing all the images without noticeable quality loss. The resulting images are optimized for web and between 50% to 92% smaller than the original which instantly improves your website load speed and your SEO scores on long term.

Lossy and Lossless compression

Up to 92% compression rate

WordPress plugin for automatic compression

Subaccounts Manager
Easily manage your clients

JPG, PNG, GIF, WebP support

PHP, Python, Node.js libraries for your projects

CLI Tool for automatic compression

Windows, Linux, OSX Support

Detailed Statistics

Single key multiple sites

GDPR Friendly

24/7 Support

WordPress Plugin for Image Optimization

With the WordPress plugin you can optimize your media library, retina images, nextgen galleries, the theme folder and even custom folders that contain images by your choice.

The plugin supports all common image formats such as JPEG, PNG, GIF (animated or non-animated) and also provides WebP support if enabled from the Settings.

Download More Details

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 now choose which thumbnail versions to be optimized!

WP Offload Media / WP Offload S3 support

MegaOptim integrate with WP Offload Media plugin and makes possible optimizing images in your storage bucket with amazon, google storage, digital ocean spaces and much more.

WebP support

WebP is newer image encoding format that reduces the image size up to 20% and is recommended to use nowadays. It can be enabled from the settings.

Retina support

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

WP-CLI Support

If you prefer to work from the command line we have great news for you. The plugin provides few WP CLI commands that will help you optimize your images. Get more details here.

Compatibility with other plugins

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

Built with love for developers

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');

$images = [ '/path/to/file1.jpg', '/path/to/file2.jpg' ];

$response = $megaoptim->run( $images, ['compression' => Optimizer::INTELLIGENT ] );

if( $response->isSuccessful() ) {
    foreach($response->getOptimizedFiles() as $file) {
} 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_")
# Pick up local path of the file
files = (
# 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']))
    errors = r.get('errors')
    for error in errors:
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!
} 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