CDN Image Optimizer: Edit Images via URL | LinQhost

CDN Image Optimizer – Edit Images via URL

The CDN Image Optimizer allows you to easily customize images before they are displayed on your website. By simply adding parameters to the URL, you can directly edit the output of your images. Below are some useful options to optimize your images.


Adjust image width

If you want to change the width of an image, for example to 400 pixels, use the following URL parameter:

https://www.jouwdomeinnaam.nl/content/images/some/42025/1624397443.7077-12_5.jpg?w=400

The width of the image is now fixed, while the height remains variable. See the image below as an example:


Create thumbnail

If you want to load a square image, you can capture both the width and the height, as in the example below:

https://www.jouwdomeinnaam.nl/content/images/some/42025/1624397443.7077-12_5.jpg?w=400&h=400

Now the image is square, with any empty spaces filled in with white space. See the image below:


Crop image

Want to make a square crop of an image? Add the crop parameter to the URL:

https://www.jouwdomeinnaam.nl/content/images/some/42025/1624397443.7077-12_5.jpg?w=400&h=400&c=1

This takes the largest possible crop of the image, with minimal clipping.



Adjust image quality

You can reduce the quality (and therefore the file size) of an image using the Q parameter. For example:

https://www.jouwdomeinnaam.nl/content/images/some/42025/1624397443.7077-12_5.jpg?w=400&q=10

The quality has now been reduced to 10%, which can significantly reduce the file size.



Add Blur

The B parameter allows you to add a blur effect to your image:

https://www.jouwdomeinnaam.nl/content/images/some/42025/1624397443.7077-12_5.jpg?w=400&b=1

The blur effect is now applied. You can use values between 0 and 3 for the intensity of the blur.
.


Keep original image size

If you want to keep the original size of the image, use the S parameter:

https://www.jouwdomeinnaam.nl/content/images/some/42025/1624397443.7077-12_5.jpg?s=1

The image now remains in its original size, without any adjustments being made.



URL Signing


URL signing allows you to optimize and secure external images by generating a unique signature specific to your images.

1. Receive your unique key from us, such as:

f61739f5a93ddab5da5104cf3bf3367815ab1db7654a8c47e521a5beef7fc

2. Create a SHA256 hash of the image URL combined with your unique key. For example:

echo -n https://externdomein.com/images/logo.png.f61739f5a93ddab5da5104cf3bf3367815ab1db7654a8c47e521a5beef7fc | shasum -a 256

3. Use the generated key in the URL to load the image, like so:

https://uwcdndomein.com/mijnproxy/s/#key#/https://externdomein.com/images/logo.png

This URL can be further extended with the other optimization parameters described above.