Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Working with Node.js
      • Node.js Behavior in Heroku
      • Troubleshooting Node.js Apps
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Working with AI
    • Heroku Inference
      • Inference API
      • Quick Start Guides
      • AI Models
      • Inference Essentials
    • Vector Database
    • Model Context Protocol
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Add-ons
  • All Add-ons
  • Zara 4
Zara 4

This add-on is operated by Zara 4

Compress images by up to 90% with no visible loss of quality.

Zara 4

Last updated November 24, 2023

The Zara 4 add-on is currently in beta.

Table of Contents

  • Provisioning the add-on
  • Local setup
  • API access
  • Using with PHP
  • Using with Java
  • Using with Ruby
  • Using with WordPress
  • Dashboard
  • Web interface
  • Teams
  • Migrating between plans
  • Removing the add-on
  • Support

Zara 4 is a powerful image compression service that can reduce the file-size of your images by up to 90% with no visible loss of quality.

Images are the largest component of data transfer for the majority of websites. By using Zara 4 to compress your images you can significantly reduce the amount of data visitors to your site download. Less data to download equals improved user experience and fast loading pages.

Reducing the amount of data you transfer sending images reduces the load on your servers, and can save you money in data transfer and storage fees. Compressing your images can also improve your search engine optimisation as well as helping your site to be more mobile friendly.

Zara 4 currently supports JPEG, PNG, GIF (including animated) and SVG image formats.

Overview of features

Zara 4 offers:

  • Image compression (up to and beyond 90% depending on the image)
  • Image resizing (for JPEG and PNG)
  • Color enhancement (for JPEG and PNG)
  • Images load from blurry to sharp (for JPEG)
  • Web interface
  • Team support
  • API access with SDK’s
  • WordPress plugin

Zara 4 is accessible via an API and has supported client libraries for PHP and Java

Provisioning the add-on

Zara 4 can be attached to a Heroku application via the CLI:

A list of all plans available can be found here.

$ heroku addons:create zara-4
-----> Adding zara-4 to sharp-mountain-4005... done, v18 (free)

Once Zara 4 has been added a ZARA_4_API_CLIENT_ID and ZARA_4_API_CLIENT_SECRET setting will be available in the app configuration, containing the API credentials used to authenticate your application. This can be confirmed using the heroku config:get command.

$ heroku config:get ZARA_4_API_CLIENT_ID
iR7Bp771l8R13865NAvc444Jm2uEr33j96l22pEK
$ heroku config:get ZARA_4_API_CLIENT_SECRET
lAXyx6wnfU0jUvKhPuMorljFNxsXeqcO0eNrEPrn

After installing Zara 4 the application should be configured to fully integrate with the add-on.

Local setup

Environment setup

After provisioning the add-on it’s necessary to locally replicate the config vars so your development environment can operate against the service.

Use the Heroku Local command-line tool to configure, run and manage process types specified in your app’s Procfile. Heroku Local reads configuration variables from a .env file. To view all of your app’s config vars, type heroku config. Use the following command for each value that you want to add to your .env file.

$ heroku config:get ZARA_4_API_CLIENT_ID -s  >> .env
$ heroku config:get ZARA_4_API_CLIENT_SECRET -s  >> .env

Credentials and other sensitive configuration values should not be committed to source-control. In Git exclude the .env file with: echo .env >> .gitignore.

For more information, see the Heroku Local article.

API access

Zara 4 offers extensive API support allowing you to seamlessly integrate automated image compression into your applications. API access is included for all accounts giving you access to a powerful platform, capable of integrating with any application.

Your API credentials are stored as the config variables ZARA_4_API_CLIENT_ID and ZARA_4_API_CLIENT_SECRET. You can modify your API credentials for your account here.

The easiest way to integrate Zara 4 into your application is to to use our SDK’s

  • PHP SDK (see GitHub)
  • Java SDK (see GitHub)
  • Ruby SDK (see GitHub)

Using with PHP

To integrate Zara 4 into your PHP application download and install the Zara 4 PHP SDK into your application.

Local image

To process images on your local machine you should use a LocalImageRequest. This uploads the image from your machine to Zara 4 for processing.

use Zara4\API\Client;
use Zara4\API\ImageProcessing\LocalImageRequest;
use Zara4\API\ImageProcessing\ProcessedImage;

$apiClient = new Client(getenv("ZARA_4_API_CLIENT_ID"), getenv("ZARA_4_API_CLIENT_SECRET"));
$originalImage = new LocalImageRequest("/path/to/original-image.jpg");
$processedImage = $apiClient->processImage($originalImage);
$apiClient->downloadProcessedImage($processedImage, "/where/to/save/compressed-image.jpg");

Remote image

To process images from a remote location (such as a website url), you should use a RemoteImageRequest. This downloads the image from the remote location to Zara 4 for processing. The image url given must be publicly accessible.

use Zara4\API\Client;
use Zara4\API\ImageProcessing\RemoteImageRequest;
use Zara4\API\ImageProcessing\ProcessedImage;

$apiClient = new Client(getenv("ZARA_4_API_CLIENT_ID"), getenv("ZARA_4_API_CLIENT_SECRET"));
$originalImage = new RemoteImageRequest("https://example.com/original-image.jpg");
$processedImage = $apiClient->processImage($originalImage);
$apiClient->downloadProcessedImage($processedImage, "/where/to/save/compressed-image.jpg");

Options

You can customise how your images are processed with Zara 4 by altering your request options.

use Zara4\API\Client;
use Zara4\API\ImageProcessing\LocalImageRequest;

$apiClient = new Client(getenv("ZARA_4_API_CLIENT_ID"), getenv("ZARA_4_API_CLIENT_SECRET"));
$originalImage = new LocalImageRequest("/path/to/original-image.jpg");

// Change request options
$originalImage->optimisationMode = OptimisationMode::HIGHEST;
$originalImage->colourEnhancement = ColourEnhancement::IMPROVE_COLOUR;
$originalImage->resizeMode = ResizeMode::NONE;

$processedImage = $apiClient->processImage($originalImage);
$apiClient->downloadProcessedImage($processedImage, "/where/to/save/compressed-image.jpg");

Using with Java

To integrate Zara 4 into your Java application download and install the Zara 4 Java SDK into your application.

Local image

To process images on your local machine you should use a LocalImageRequest. This uploads the image from your machine to Zara 4 for processing.

import com.zara4.api.*;

Client apiClient = Client(System.getenv("ZARA_4_API_CLIENT_ID"), System.getenv("ZARA_4_API_CLIENT_SECRET"));
LocalImageRequest originalImage = new LocalImageRequest("/path/to/original-image.jpg");
ProcessedImage processedImage = apiClient.processImage(originalImage);
apiClient.downloadProcessedImage(processedImage, "/where/to/save/compressed-image.jpg");

Remote image

To process images from a remote location (such as a website url), you should use a RemoteImageRequest. This downloads the image from the remote location to Zara 4 for processing. The image url given must be publicly accessible.

import com.zara4.api.*;

Client apiClient = Client(System.getenv("ZARA_4_API_CLIENT_ID"), System.getenv("ZARA_4_API_CLIENT_SECRET"));
RemoteImageRequest originalImage = new RemoteImageRequest("https://example.com/original-image.jpg");
ProcessedImage processedImage = apiClient.processImage(originalImage);
apiClient.downloadProcessedImage(processedImage, "/where/to/save/compressed-image.jpg");

Options

You can customise how your images are processed with Zara 4 by altering your request options.

import com.zara4.api.*;

Client apiClient = Client(System.getenv("ZARA_4_API_CLIENT_ID"), System.getenv("ZARA_4_API_CLIENT_SECRET"));
LocalImageRequest originalImage = new LocalImageRequest("/path/to/original-image.jpg");

// Change request options
originalImage.optimisationMode = OptimisationMode.HIGHEST;
originalImage.colourEnhancement = ColourEnhancement.IMPROVE_COLOUR;
originalImage.resizeMode = ResizeMode.NONE;

ProcessedImage processedImage = apiClient.processImage(originalImage);
apiClient.downloadProcessedImage(processedImage, "/where/to/save/compressed-image.jpg");

Using with Ruby

To integrate Zara 4 into your Ruby application download and install the Zara 4 Ruby SDK into your application.

Local image

To process images on your local machine you should use a LocalImageRequest. This uploads the image from your machine to Zara 4 for processing.

require 'zara4'

api_client = Zara4::API::Client.new({
  'client_id'     => ENV['ZARA_4_API_CLIENT_ID'],
  'client_secret' => ENV['ZARA_4_API_CLIENT_SECRET']
})
original_image = Zara4::API::ImageProcessing::LocalImageRequest.new('/path/to/original-image.jpg')
processed_image = api_client.process_image(original_image)
api_client.download_processed_image(processed_image, '/where/to/save/compressed-image.jpg')

Remote image

To process images from a remote location (such as a website url), you should use a RemoteImageRequest. This downloads the image from the remote location to Zara 4 for processing. The image url given must be publicly accessible.

require 'zara4'

api_client = Zara4::API::Client.new({
  'client_id'     => ENV['ZARA_4_API_CLIENT_ID'],
  'client_secret' => ENV['ZARA_4_API_CLIENT_SECRET']
})
original_image = Zara4::API::ImageProcessing::RemoteImageRequest.new('https://example.com/original-image.jpg')
processed_image = api_client.process_image(original_image)
api_client.download_processed_image(processed_image, '/where/to/save/compressed-image.jpg')

Options

You can customise how your images are processed with Zara 4 by altering your request options.

require 'zara4'

api_client = Zara4::API::Client.new({
  'client_id'     => ENV['ZARA_4_API_CLIENT_ID'],
  'client_secret' => ENV['ZARA_4_API_CLIENT_SECRET']
})
original_image = Zara4::API::ImageProcessing::RemoteImageRequest.new('https://example.com/original-image.jpg')

original_image.optimisation_mode  = Zara4::API::ImageProcessing::OptimisationMode::HIGHEST
original_image.colour_enhancement = Zara4::API::ImageProcessing::ColourEnhancement::IMPROVE_COLOUR
original_image.resize_mode        = Zara4::API::ImageProcessing::ResizeMode::CROP
original_image.width              = 250
original_image.height             = 250

processed_image = api_client.process_image(original_image)
api_client.download_processed_image(processed_image, '/where/to/save/compressed-image.jpg')

Using with WordPress

If you’re running WordPress on Heroku, you can install Zara 4 in seconds by installing the Zara 4 WordPress Plugin. Enter your API credentials and the plugin will do the rest.

The Zara 4 WordPress plugin provides automatic image compression, meaning images are compressed as you upload them. You can restore your original (uncompressed) images at any time. Existing images can be compressed individually or batch processed by using the bulk action ‘Compress with Zara 4’ from the WordPress Media Library.

Dashboard

The Zara 4 dashboard let’s you view information about your account. You can monitor your image processing usage and change your account settings.

The dashboard can be accessed via the CLI:

$ heroku addons:open zara-4
Opening zara-4 for sharp-mountain-4005

or by visiting the Heroku Dashboard and selecting the application in question. Select Zara 4 from the Add-ons menu.

Web interface

Zara 4 provides a simple drag and drop web interface allowing you to upload images to be compressed manually. Access your account through Heroku and you can instantly start compressing your images.

Teams

Zara 4 is built for team working, allowing you to stay in control whilst giving your team access to compress their images.

Zara 4 allows you to share your image processing quota and data with other users invited to join your team. Team working is included for all accounts (even free) meaning you can invite anyone to work with you.

Migrating between plans

Application owners should carefully manage the migration timing to ensure proper application function during the migration process.

Use the heroku addons:upgrade command to migrate to a new plan.

$ heroku addons:upgrade zara-4:premium
-----> Upgrading zara-4:premium to sharp-mountain-4005... done, v18 ($21.75/mo)
       Your plan has been updated to: zara-4:premium

Removing the add-on

Zara 4 can be removed via the CLI.

This will destroy all associated data and cannot be undone!

$ heroku addons:destroy zara-4
-----> Removing zara-4 from sharp-mountain-4005... done, v20 (free)

Support

All Zara 4 support and runtime issues should be submitted via on of the Heroku Support channels. Any non-support related issues or product feedback is welcome please contact us or email us at support@zara4.com.

Keep reading

  • All Add-ons

Feedback

Log in to submit feedback.

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices