imgproxy README

The project's README from github.com/imgproxy/imgproxy. As one markdown file: README.md.

imgproxy logo

Website | Blog | Documentation | imgproxy Pro

Docker Bluesky X X Discord

CI


imgproxy is a fast and secure standalone server for resizing, processing, and converting images. The guiding principles behind imgproxy are speed, security, and simplicity.

imgproxy is able to quickly and easily resize, process, and optimize images on the fly, and it's well-equipped to handle a large amount of image processing. imgproxy is a drop-in replacement for all the image processing code inside your web application (such as using image processing libraries or calling command-line tools). With imgproxy, you don’t need to repeatedly re-prepare images to fit your design every time it changes, as imgproxy does this on demand.

To get an even better introduction and to dive deeper into the nitty-gritty details, check out this article by Evil Martians: imgproxy: Resize your images instantly and securely

imgproxy demo Photo by Joshua Patton

✨ Features

imgproxy is packed with features to the brim to cover all your image processing needs:

Feature imgproxy OSS imgproxy Pro
Image formats Basic formats: JPEG, PNG, GIF, WebP, AVIF, JPEG XL, and more Preview generation for video, PDF, and Photoshop documents
Processing Resizing, cropping, rotating, watermarking, filters Getting image info, advanced watermarking, color adjustment
Optimization Color profile and metadata stripping, PNG quantization Advanced compression settings, GIF to MP4 conversion, SVG minification
Smart features Simple smart cropping, auto-quality by file size Object detection, advanced smart cropping, auto-quality by SSIM, best format selection

Check out the full feature list for more details.

🛠️ How it works

imgproxy works as a standalone HTTP server. You provide it with a source image URL and a set of processing options via a specially crafted URL, and imgproxy fetches the image, processes it according to your specifications, and serves the resulting image back to you. You can use imgproxy URLs directly in your HTML, CSS, or JavaScript code, just like you would with any other image URL.

This way, imgproxy offloads all the image processing work from your application. The only thing your application needs to do is to generate imgproxy URLs with the desired processing options.

How imgproxy works scheme

⚖️ Main principles

Simplicity

Keep it simple, stupid!

We believe that software should be simple yet powerful. If your grandma can't get it up and running, you should make it simpler. That's why we designed imgproxy to be ready to use in a couple of minutes with minimal configuration. Check out the Getting Started guide to see how easy it is.

No code is better than no code.

We believe in the single responsibility principle. If something can be done better outside of imgproxy, we won't reinvent the wheel. As a couple of examples:

Speed

We strive to tune every little piece of imgproxy to make it as fast as possible.

imgproxy takes advantage of probably the most efficient image processing library out there – libvips. It’s scary fast and comes with a very low memory footprint. Our extensive experience with libvips has enabled us to optimize our image-processing pipeline to its maximum.

You can take a look at some benchmarking results and compare imgproxy with some well-known alternatives in our benchmark report.

Security

Image processing is a wide attack surface. That's why we treat security very seriously. imgproxy offers several security measures that enable you to strike the optimal balance between security and usability for your specific use case. For example:

Check out our documentation for more details on security features.

🚀 Getting started

The easiest and recommended way to run imgproxy is using Docker. It's just a matter of a single command:

docker run -p 8080:8080 -it ghcr.io/imgproxy/imgproxy:latest

That's it! imgproxy is ready to accept image processing requests at http://localhost:8080.

Check out the Getting Started guide for a step-by-step tutorial on how to get your first image processed with imgproxy.

📚 Documentation

You can find the full documentation at docs.imgproxy.net.

💙 Supporting imgproxy

imgproxy is not a side project; it's what we do for a living. We work hard to make it better every day. If you find imgproxy useful and want to support its development, here are some ways you can do that:

🙏 Special thanks

Many thanks to:

📄 License

imgproxy is licensed under the Apache License 2.0.

See LICENSE for the full license text.

⚠️ Security Contact

To report a security vulnerability, please contact us at [email protected]. We will coordinate the fix and disclosure.

imgproxy (imgproxy/imgproxy)

Searching Database…

11.1K ·GitHub
这是什么?imgproxy 是一个快速、独立运行的服务器,可以根据你提供的源 URL 获取图片,并实时进行缩放、裁剪、格式转换和优化。
它是我需要导入的库,还是一个独立的服务器?它是一个独立的 HTTP 服务器,而不是库:你把图片 URL 和编码在特殊 URL 中的处理选项一起发送给它,它就会返回处理后的图片。
怎样才能让它运行起来?推荐使用 Docker:用一条命令运行官方镜像,imgproxy 就能立即开始接收请求。
我需要先安装什么特别的东西吗,比如 libvips?imgproxy 的图片处理流程基于 libvips 构建,但它已经打包在 Docker 镜像中,所以你不需要自己安装。
我需要自己设置 HTTPS 或 CDN 吗?需要。imgproxy 有意不实现 HTTPS,因为在生产环境中,它预期运行在 CDN、负载均衡器或反向代理之后。
它支持哪些图片格式?基础格式包括 JPEG、PNG、GIF、WebP、AVIF 和 JPEG XL 等。
免费版和 imgproxy Pro 有什么区别?开源版涵盖基础的缩放、裁剪、水印和简单的智能裁剪,而 Pro 版增加了视频、PDF 和 Photoshop 预览、高级水印、基于对象检测的智能裁剪、SSIM 自动画质,以及 GIF 转 MP4 转换。
它为什么这么快?它使用 libvips 这个高效、低内存占用的图像处理库,并且团队围绕它对处理流程做了大量优化。
设计改动后,我需要自己重新生成图片吗?不需要。imgproxy 会按需从原始来源处理图片,因此每次设计改动时,你都不必重新准备固定尺寸的图片素材。
Creator
imgproxy
Size
42.8 MB
Stars
11.1K
Age
9y
Commits · 90 Days