![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
High-performance, cross-platform Rust/WebAssembly image processing library
Photon is a high-performance Rust image processing library, which compiles to WebAssembly, allowing for safe, blazing-fast image processing both natively and on the web.
View the official demo of WASM in action.
Check out Photon's getting started guide, complete with tutorials, installation instructions, and more
View the official documentation.
96 customisable functions are available.
Resize, transform, correct, and filter images: apply as many effects as desired.
Functions include:
Add the following line to the dependencies section of your Rust project's Cargo.toml:
[dependencies]
photon-rs = "0.1.0"
Install Photon as an npm module:
npm install --save @silvia-odwyer/photon
To install Photon as an npm module for Node.JS use:
npm install --save @silvia-odwyer/photon-node
The following code opens an image from the filesystem, applies an effect, and saves it.
Here is a code sample to get you started:
extern crate photon_rs;
use photon_rs::native::{open_image, save_image};
fn main() {
// Open the image (a PhotonImage is returned)
let mut img = open_image("test_image.png");
// Increment the red channel by 40
photon_rs::channels::alter_red_channel(&mut img, 40);
// Write file to filesystem.
save_image(img, "raw_image.jpg");
}
For more examples, check out the guide on how to get started with Photon natively.
Photon contains a series of modules, which include:
effects
: Various image effects, including adding offsets, thresholding, duotoning, solarization, etc.,channels
: Functions related to increasing/decreasing the red, green, and blue channels of the image data.filters
: Preset filters, which alter the rgb channels of the image. Contains over 20.conv
: Laplace, Sobel, emboss; image proc functions which require image convolution.noise
: Noise generation of varying tints and hues.multiple
: A module for dealing with multiple images, such as watermarking images, etc.,correction
: Hue rotation, adjusting saturation, lightening/darkening: all techniques available in multiple colour spaces, which lead to varying effects.All effects and filters can be viewed below and on the official website.
Clone this crate's official GitHub repo:
git clone https://github.com/silvia-odwyer/photon
Run the binary, which will perform an image processing function on an image:
cd crate
cargo run --release
Compare the original image with the outputted image, and you'll see the desired effect has been applied.
If you'd like to chat to the developer about your potential use case, or have further questions about this library, just submit them here, and I'll get back to you!
This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details.
FAQs
High-performance image processing library for native use and the web
We found that photon-rs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.