Image transformations web service. Provides Http API to image manipulation operations.
10K+
Open Source Image CDN that provides image transformation API and supports the latest image formats, such as WebP, AVIF and network client hints.
We wrote a big blog on this, and here is TLDR:
Transformimgs is an image CDN for Web, so API must cover typical use cases, like thumbnails, zoom in product images, etc. Any new API endpoints must solve the above problems.
The goal is to have zero-config API that makes decisions based on the input, so you don't need to provide additional parameters like quality, output format, type of compression, etc.
Therefore, this allows you to configure the integration once. New features, like new image formats, will work with your front end automatically without any changes.
To achieve that goal we should keep API to bare minimum and hide the smartness in the implementation.
There is an example of running API behind reverse proxy with integration example in quickstart/ folder.
To run:
cd quickstart
docker-compose up
open https://localhost
The API has 4 HTTP endpoints:
Docs:
MjUyMTM3OTQyNw__ which allows to transform any image from pixabay.comThe latest docker image published on Docker hub
Starting the server:
$ docker run -p 8080:8080 pixboost/transformimgs [OPTIONS]
To verify:
curl http://localhost:8080/healthopen http://localhost:8080/img/https://images.unsplash.com/photo-1591769225440-811ad7d6eab3/resize?size=600Everything below is optional and have sensible defaults.
| Option | Description | Default |
|---|---|---|
| cache | Number of seconds to cache image(0 to disable cache). Used in max-age HTTP response. | 2592000 (30 days) |
| proc | Number of images processors to run. | Number of CPUs (cores) |
| disableSaveData | If set to true then will disable Save-Data client hint. Should be disabled on CDNs that don't support Save-Data header in Vary. | false |
Prerequisites:
/usr/local/bin$ git clone [email protected]:Pixboost/transformimgs.git
$ cd transformimgs
$ ./run.sh
We run SaaS version at pixboost.com with generous free tier.
Perks of SaaS version:
Go modules have been introduced in v6.
There is a JMeter performance test you can run against a service. To run tests:
$ docker-compose -f docker-compose-perf.yml up
$ jmeter -n -t perf-test.jmx -l ./results.jmx -e -o ./results
$ jmeter -n -t perf-test-webp.jmx -l ./results-webp.jmx -e -o ./results-webp
$ jmeter -n -t perf-test-avif.jmx -l ./results-avif.jmx -e -o ./results-avif
Shout out with any ideas. PRs are more than welcome.
Content type
Image
Digest
sha256:f82c5e8fd…
Size
219.3 MB
Last updated
over 1 year ago
docker pull pixboost/transformimgs