Pixboost
  • Overview
  • Quickstart
  • Tools and Setup
    • Source Images
      • Adding Source Image Domain
      • Adding HTTP Image Source
      • Adding AWS S3 Bucket Image Source
    • Managing API Keys
    • Managing Users
    • Snippet Generator
    • Custom Domain Name
    • Cache Invalidation
    • HTTP/2 Support
    • HTTP/3 Support
  • API. URL-based integration
    • Resize
    • Fit
    • Optimise
    • As is
  • Using with React
  • Shopify Integration
  • Automated Workflows
    • Cache Invalidation
    • Warmup
    • API Secrets
  • Performance Testing
  • Open Source Version
Powered by GitBook
On this page
  • Description
  • Parameters
  • Examples

Was this helpful?

  1. API. URL-based integration

Optimise

PreviousFitNextAs is

Last updated 1 year ago

Was this helpful?

API endpoint - /api/2/img/[IMAGE-URL]/optimise

Description

Optimise - optimises images using lossy compression automatically.

Parameters

dppx (optional) - Number of dots per pixel defines the ratio between device and CSS pixels. The query parameter is a hint that enables extra optimisations for high density screens. The format is a float number in the same format as window.devicePixelRatio.

trim-border(optional) - Will remove the edges of the image with the same color, if the option specified.

Examples

  • dppx=2 - sending a hint to the API that screen has DPI=2

Parameters
Image

Original

No parameters

dppx=2

Original

trim-border

You can see URL of the examples by "right-click -> Copy Image address"