Compress Images API

Reduce the size of your PNG and JPG files up to 75%.

Try it Out API Documentation

Reduce File Size Significantly

Our technology reduces the size of JPG and PNG images significantly. Depending on the input file, we can reduce the size up to 75% while retaining good quality. Checkout our online converter and try it out with your own example files.

Advanced Options

Depending on your needs you can adjust the output quality. We even do support adding watermarks to the output files. Check out the API documentation to show all available options, depending on the conversion type.

Async or Sync

By default, the CloudConvert API converts your files asynchronously and we notify you via webhooks when we are done. Depending on your needs there is also a synchronous API to convert files on-the-fly.

Storage Integration

CloudConvert directly fetches the input files from your object storage and then stores the output file at the same place. We are integrated with your existing and trusted storage provider, such as S3, Azure, Google Cloud or many others.

Custom Workflows

Our API uses the concept of Jobs and allows to do multiple operations with one single API call. For example, it is possible to convert the same file to multiple output formats, adding a watermark and creating a thumbnail with one single Job!

Developer Friendly

Our extensive API Documentation helps to get you started quickly. There is a Job Builder which generates ready-to-use request payloads and code snippets for you. We do provide free and timely support, directly from the builders of CloudConvert.

Original

214 KB

Compressed

82 KB

Raw Request PHP node.js Ruby Python Java .NET

POST https://sync.api.cloudconvert.com/v2/jobs
{
  "tasks": {
    "import-my-file": {
      "operation": "import/url",
      "url": "https://my.url/file.jpg"
    },
    "compress-my-file": {
      "operation": "optimize",
      "input": "import-my-file",
      "input_format": "jpg",
      "quality": 75
    },
    "export-my-file": {
      "operation": "export/url",
      "input": "compress-my-file"
    }
  },
  "redirect": true
}
<?php
$job = (new Job())
    ->addTask(
        (new Task('import/url', 'import-my-file'))
            ->set('url', 'https://my.url/file.jpg')
    )
    ->addTask(
        (new Task('optimize', 'compress-my-file'))
            ->set('input', 'import-my-file')
            ->set('input_format', 'jpg')
            ->set('quality', 75)
    )
    ->addTask(
        (new Task('export/url', 'export-my-file'))
            ->set('input', 'compress-my-file')
    );

$cloudconvert->jobs()->create($job);
let exampleJob = await cloudConvert.jobs.create({
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://my.url/file.jpg"
        },
        "compress-my-file": {
            "operation": "optimize",
            "input": "import-my-file",
            "input_format": "jpg",
            "quality": 75
        },
        "export-my-file": {
            "operation": "export/url",
            "input": "compress-my-file"
        }
    }
});

job = await cloudConvert.jobs.wait(job.id);
job = cloudconvert.jobs.create({
  tasks: [
    {
      name: "import-my-file",
      operation: "import/url",
      url: "https://my-url/file.jpg"
    },
    {
      name: "compress-my-file",
      operation: "optimize",
      input: "import-my-file",
      input_format: "jpg",
      quality: 75
    },
    {
      name: "export-my-file",
      operation: "export/url",
      input: "compress-my-file"
    },
  ]
})
job = cloudconvert.Job.create(payload={
     "tasks": {
         'import-my-file': {
              'operation': 'import/url',
              'url': 'https://my.url/file.jpg'
         },
         'compress-my-file': {
             'operation': 'convert',
             'input': 'import-my-file',
             'input_format': 'jpg',
             'quality': 75
         },
         'export-my-file': {
             'operation': 'export/url',
             'input': 'compress-my-file'
         }
     }
 })
final JobResponse createJobResponse = cloudConvertClient.jobs().create(
    ImmutableMap.of(
        "import-my-file",
            new UrlImportRequest()
                .setUrl("https://my.url/file.jpg"),
        "compress-my-file",
            new OptimizeFilesTaskRequest()
                .setInput("import-my-file")
                .setInputFormat("jpg"),
                .set("quality", 75),
        "export-my-file",
            new UrlExportRequest()
                .setInput("compress-my-file")
    )
).getBody();
var job = await CloudConvert.CreateJobAsync(new JobCreateRequest
      {
        Tasks = new
        {
          import_it = new ImportUrlCreateRequest
          {
            Url = "https://my.url/file.jpg"
          },
          compress = new OptimizeCreateRequest
          {
            Input = "import_it",
            Input_Format = "jpg",
            Quality = 75
          },
          export_it = new ExportUrlCreateRequest
          {
            Input = "compress"
          }
        }
      });

Use our Job Builder to generate ready-to-use requests and code snippet for the CloudConvert API.

Job Builder API Documentation
On-demand, transparent pricing

Starting at 0.00 per file

When Converting Files

Corresponds to a one-timemonthly payment of . Checkout the full pricing information.