😱 Dead fast thumbnail library for browser and NodeJs! Built with Rust πŸ¦€ and WebAssembly πŸ•Έ

Overview

thumbo-core

😱 Dead fast thumbnail library for browser and NodeJs

Build & Test

Built with Rust πŸ¦€ & WebAssembly πŸ•Έ

πŸ“– About

thumbo-core is a thubnail library for browsers and NodeJs, built with Rust and WebAssembly in other to achieve closer to native speed!

It supports thumbnail generation for Png, Jpeg, Gif, Ico, Webp and Svg! Webp support is a work in progress.

πŸ“£ If you plan to use thumbo-core, it should be used with a Webworker so you don't block the main thread! If you don't want to go through this hassle, use thumbo, it provides a worker pool to handle thumbnail generation using thumbo-core out of the box.

🚴 Usage

πŸ§ͺ Sample usage

import * as thumbo from "thumbo-core";

const img = await fetch("/path/to/img.png");

const thumbnail = thumbo.thumbnail(
  new Uint8Array(await img.arrayBuffer()),
  thumbo.ImageFormat.Png,
  20,
  20
);

const thumbnail_blob = new Blob([thumbnail], { type: "image/png" });
const url = URL.createObjectURL(thumbnail_blob);

document.getElementById("img").src = url;

βš™οΈ API Reference

thumbo.ImageFormat

An enum of image formats supported by thumbo-core.

thumbo.thumbnail(image_buffer: Uint8Array, format: thumbo.ImageFormat, width, height)

Creates a thumbnail from the provided image buffer.

πŸ‘·πŸ½ Development

πŸ› οΈ Build with wasm-pack build

wasm-pack build

πŸ”¬ Test in Headless Browsers with wasm-pack test

wasm-pack test --headless --chrome

🎁 Publish to NPM with wasm-pack publish

wasm-pack publish
You might also like...
A Rust library for calculating perceptual hash values of images

img_hash Now builds on stable Rust! (But needs nightly to bench.) A library for getting perceptual hash values of images. Thanks to Dr. Neal Krawetz f

A simple steganography library written in rust

steganography A stable steganography library written in rust Crates.io Usage Add the following to the Cargo.toml in your project: [dependencies] stega

Face detection library for the Rust programming language
Face detection library for the Rust programming language

Rustface SeetaFace detection library for the Rust programming language Example of demo program output SEETAFACE C++ – Github repository for the origin

A Simple-to-use, cross-platform Rust Webcam Capture Library

Cross Platform Rust Library for powerful Webcam Capture and Virtual Webcams

An advanced image processing library for Rust.

ImageProc Maintainers: @chyh1990 Note: this project is under active depvelopment, API may change! imageproc is a advanced image proccessing library fo

Image operation rust library

Image operation rust library

Antialiased 2D vector drawing library in Rust for Android, Web, Desktop
Antialiased 2D vector drawing library in Rust for Android, Web, Desktop

nonaquad Vector anti-aliased graphics renderer for Android, WASM, Desktop in Rust, using miniquad. This library started as a port of NanoVG for miniqu

Antialiased 2D vector drawing library written in Rust
Antialiased 2D vector drawing library written in Rust

femtovg Join the femtovg Discord channel Work in progress! Antialiased 2D vector drawing library written in Rust.

A linear algebra and mathematics library for computer graphics.

cgmath-rs A linear algebra and mathematics library for computer graphics. The library provides: vectors: Vector2, Vector3, Vector4 square matrices: Ma

Comments
  • Configure Renovate

    Configure Renovate

    WhiteSource Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • Cargo.toml (cargo)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation
    • If semantic commits detected, use semantic commit type fix for dependencies and chore for all others
    • Ignore node_modules, bower_components, vendor and various test/tests directories
    • Autodetect whether to pin dependencies or maintain ranges
    • Rate limit PR creation to a maximum of two per hour
    • Limit to maximum 20 open PRs at any time
    • Group known monorepo packages together
    • Use curated list of recommended non-monorepo package groupings
    • Fix some problems with very old Maven commons versions
    • Ignore spring cloud 1.x releases
    • Ignore http4s digest-based 1.x milestones
    • Use node versioning for @types/node
    • Limit concurrent requests to reduce load on Repology servers until we can fix this properly, see issue 10133

    πŸ”‘ Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    With your current configuration, Renovate will create 3 Pull Requests:

    chore(deps): update rust crate wasm-bindgen-test to 0.3.28
    • Schedule: ["at any time"]
    • Branch name: renovate/wasm-bindgen-test-0.x
    • Merge into: main
    • Upgrade wasm-bindgen-test to 0.3.28
    fix(deps): update rust crate console_error_panic_hook to 0.1.7
    • Schedule: ["at any time"]
    • Branch name: renovate/console_error_panic_hook-0.x
    • Merge into: main
    • Upgrade console_error_panic_hook to 0.1.7
    fix(deps): update rust crate wasm-bindgen to 0.2.78
    • Schedule: ["at any time"]
    • Branch name: renovate/wasm-bindgen-0.x
    • Merge into: main
    • Upgrade wasm-bindgen to 0.2.78

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 1
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 7% πŸŽ‰

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /examples/src/images/content/logo.png | 1.86kb | 1.57kb | 15.72% | | /examples/src/images/content/passport.jpg | 8,753.80kb | 8,129.45kb | 7.13% | | /examples/src/images/content/wallpaper.jpg | 4,895.76kb | 4,618.82kb | 5.66% | | | | | | | Total : | 13,651.41kb | 12,749.84kb | 6.60% |


    πŸ“ docs | :octocat: repo | πŸ™‹πŸΎ issues | πŸͺ marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 0
Owner
Victor Aremu
πŸ‘©β€πŸŽ¨ Artisan of logics and pixels
Victor Aremu
Rust library for fast image resizing with using of SIMD instructions.

fast_image_resize Rust library for fast image resizing with using of SIMD instructions. CHANGELOG Supported pixel formats and available optimisations:

Kirill Kuzminykh 115 Jan 5, 2023
Motion detection & video recording software based on OpenCV, built for research on Bumblebees

BombusCV Motion detection & video recording software based on OpenCV, built for research on Bumblebees (hence the name). Index Use case Examples Insta

Marco Radocchia 7 Dec 27, 2022
Rust Lean Image Viewer - Fast and configurable image viewer inspired by JPEGView by David Kleiner

Rust Lean Image Viewer - Fast and configurable image viewer inspired by JPEGView by David Kleiner

3top1a 4 Apr 9, 2022
A Rust encoder/decoder for Dominic Szablewski's QOI format for fast, lossless image compression.

QOI - The β€œQuite OK Image” format This is a Rust encoder and decoder for Dominic Szablewski's QOI format for fast, lossless image compression. See the

Chevy Ray Johnston 62 Nov 29, 2022
Foxtrot is a fast viewer for STEP files, a standard interchange format for mechanical CAD

Foxtrot is a fast viewer for STEP files, a standard interchange format for mechanical CAD. It is an experimental project built from the ground up, including new libraries for parsing and triangulation.

null 160 Jan 3, 2023
A fast wordlist to nthash converter

nthasher A fast wordlist to nthash converter Usage Pass it a UTF8 encoded wordlist, and write the output to a file. ./nthasher <wordlist> > wordlist.n

Dominic White 18 Nov 3, 2022
A lightning-fast Sixel serializer/deserializer

sixel-image This is a (pretty fast!) sixel serializer/deserializer with cropping support. It accepts a sixel serialized string byte-by-byte, deseriali

null 12 Oct 27, 2022
Fast encoder/decoder for the lossless DTM 16 bit image format

DTM Image Format Fast encoder/decoder for the DTM image format. The DTM image format is a 16-bit lossless image format supporting one to four channels

Kurt KΓΌhnert 4 Oct 15, 2022
PNG decoding and encoding library in pure Rust

PNG Decoder/Encoder PNG decoder/encoder in pure Rust. It contains all features required to handle the entirety of the PngSuite by Willem van Schack. p

image-rs 247 Dec 25, 2022
Rust library to get image size and format without loading/decoding

imageinfo-rs Rust library to get image size and format without loading/decoding. The imageinfo don't get image format by file ext name, but infer by f

xiaozhuai, Weihang Ding 47 Dec 30, 2022