photon
WASM-ImageMagick
Our great sponsors
photon | WASM-ImageMagick | |
---|---|---|
6 | 8 | |
2,481 | 835 | |
- | - | |
6.7 | 0.0 | |
4 days ago | 6 months ago | |
Rust | TypeScript | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
photon
-
Show HN: OS Image processing API running on edge functions using Rust and WASM
Image processing/transformations with built-in CDNs is one of the more common solutions you would find out there but can get pretty expensive and locked in over time.
Vercel is a good example that provides a built-in “next/image” solution for the NextJS framework that optimises images for better performance, however, it gets very expensive as you scale.
Alternatively, running your own service with one of the most common image processing libraries like SharpJS is great but can get pretty difficult to run in a serverless environment with CDNs and all the other bells and whistles alongside all your other code while the cold startup time of Sharp in a serverless environment can be pretty brutal.
With all the growth around rebuilding engines in Rust for performance gains, I thought there must be an image processing library written in Rust which could be compiled to WebAssembly (WASM) and run way faster. That’s when I discovered Photon https://github.com/silvia-odwyer/photon by Silvia, who has done amazing work with the library.
This eventually led me to discover https://github.com/fineshopdesign/cf-wasm/tree/main/packages... that has already transcribed the Photon package into a WASM binary for easy use in edge v8 environments like Cloudflare workers or NextJS Edge functions.
Using these packages I built an API layer on the NextJS framework allowing you to easily process local and remote images at blazing fast speeds with a bunch of helper functions making it similar to use as most paid Image processing APIs. If hosted on Vercel, you can make use of the built-in CDN cache for files less than 10 MB at no extra charge with Edge caching.
Some of the features:
- Blazing fast image processing
- Fully serverless, runs on Vercel Edge functions
- Resize, crop, compress, tint, rotate, format and more
- Global distribution with Edge functions
- Automated CDN cache with Edge functions
- Replacement for `next/image` processing on Vercel
- Local and remote image processing
Some problems:
- The Photon lib has last been updated in 2020
- There are still a few obvious bugs when using it for more advanced requirements like 8k image processing on edge function due to poor memory management in Rust
- No sexy features right now like AI image optimisation and selective background blurring
- If you are looking for an all-in-one solution with Image Storage + image processing/CDN, this is not it (something we will be releasing soon on JigsawStack.com)
I think the Photon library and the API have a lot more potential for growth and will be hoping for more contributions from the community as Rust gets more popular!
-
Building an online image compressor
My first implementation was based on photon_rs, a Rust based web assembly library for image processing. It worked pretty well, but it was slower than OP website. Without digging much it seems logical since photon isn’t optimized for performance.
- Rust/WebAssembly image processing library
-
Image Compression Library
What you describe reminded me of photon. Check out the website. If there isn't an overlap of functionality then you can definitely integrate it into your own site.
- Off my chest: When are some of you browser devs gonna give us native image scaling? This is the best we got ATM.
-
Monitoring UX in Single Page Applications
For the image, you are able to either use your webcam to take a photo, or upload a photo of your own before moving onto the filters. Image filtering is included in most image manipulation libraries. I had used ImageMagick before, but had a terrible time with it. I wanted to find a better way to do Instagram-like filtering. I came across Photon, a high performance image processing library written in Rust and can be compiled to WebAssembly, and there was already a React demo so it was easy to integrate. Once you choose the filter you want, you move onto the decoration stage.
WASM-ImageMagick
-
Easy boxart resizing with imagemagick in your browser. No install, no CLI!
Credit: Go check it out the GitHub project page thanks to Nick Maliwacki's (KnicKnic)
- Show HN: Edit images in the browser using GPT-3 and WebAssembly
- Web Assembly ImageMagick
-
WebAssembly in my Browser Desktop Environment
Image Conversion via WASM-ImageMagick
- Native JS replacement for imagemagick?
-
Pushing The Limits Of The Modern Browser
I've gone with ImageMagick ported to WebAssembly to do basically the exact same things as with FFMpeg, but with a tiny bit less locking up. In the future I would like to get these things running in multithreaded Web Workers as well as have the ability to easily configure transcode settings to whatever is desired instead of the defaults as it is now.
-
Browsers can do that?
When it comes to audio/video the trusted tool that is often used on the desktop is FFmpeg and this too has been ported to run in the browser, although if you want multithreading you will need to make sure you have special CORS headers enabled to gain access to the SharedArrayBuffer. For images on desktop there is the popular ImageMagick which indeed also has been ported.
-
Resizing and Compressing Photos Before Upload to Django
ImageMagick is the go to for these kinda things and apparently there is a WASM version: https://github.com/KnicKnic/WASM-ImageMagick
What are some alternatives?
image - Encoding and decoding images in Rust
magick-wasm - The WASM library for ImageMagick
InputBot - Rust library for creating global hotkeys, and simulating inputs
ffmpeg.wasm - FFmpeg for browser, powered by WebAssembly
Kubewarden - Kubewarden is a policy engine for Kubernetes. It helps with keeping your Kubernetes clusters secure and compliant. Kubewarden policies can be written using regular programming languages or Domain Specific Languages (DSL) sugh as Rego. Policies are compiled into WebAssembly modules that are then distributed using traditional container registries.
wapm-cli - 📦 WebAssembly Package Manager (CLI)
Quicksilver - Quicksilver Project Source
Ionic Framework - A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
jpegoptim - jpegoptim - utility to optimize/compress JPEG files
JSZip - Create, read and edit .zip files with Javascript
menyoki - Screen{shot,cast} and perform ImageOps on the command line 🌱 🏞️
daedalOS - Desktop environment in the browser