DEV Community

Cover image for Resize and Optimise Images Using Free API - ImageCDN
Ban My Account
Ban My Account

Posted on

Resize and Optimise Images Using Free API - ImageCDN

Image description

    <h1>About ImageCDN</h1>
Enter fullscreen mode Exit fullscreen mode

Our goals are to:

  1. Improve the quality and usage of images on the web.
  2. Help improve web-performance by offering easy-to-use, advanced image compression behind a globally distributed CDN.
  3. To enable personal hacks, side-projects, start-ups, open source projects and just about anybody else with a small budget to maximise their usage of images.

Anyone is free to use this service. We only ask that you contribute to the overall service if you are able.

Sign-up for service updates

hbspt.forms.create({
region: "eu1",
portalId: "25461495",
formId: "9413ae66-f745-4b89-9890-8f3d4a973c71"
});

Documentation

GET /v2/image/{image}

Primary endpoint of ImageCDN.

Examples

  • https://imagecdn.app/v2/image/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1540665569139-922f374b8657?width=200&height=400

Query Parameters

Parameter Description
image

A URL-Encoded link to the image you wish to cache and apply transformations to.
Not sure what this means? Take a look at the Getting Started guide.
Note: The image must be reachable by the image service (contact us for whitelisting options).

height

Height of the desired image, in pixels.

width

Width of the desired image, in pixels.

format

Override the format output by the service.
Options are: `webp`, `jpg`, `png`.
Defaults to the best format supported by the current browser.

fit

How to fill the space provided by height/width.
Options are: `cover`, `contain`, `fill`, `inside` or `outside`.
Defaults to: `cover`.

Top comments (0)