All Projects β†’ vanruesc β†’ blur-up

vanruesc / blur-up

Licence: Zlib license
A tool that creates preview images.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to blur-up

react-bones
πŸ’€ Dead simple content loading components for React and React-Native. πŸ’€
Stars: ✭ 42 (+50%)
Mutual labels:  loading, preview
react-file-input-previews-base64
This package provides an easy to use, ready to go and customizable wrapper around file input, with option for image previews and returning file as base64 string.
Stars: ✭ 15 (-46.43%)
Mutual labels:  base64, preview
Orionpreview
πŸ…ΎοΈ OrionPreview is a simple animation with tanslation or scale views written in Java.
Stars: ✭ 335 (+1096.43%)
Mutual labels:  blur, preview
vue-base64-file-upload
Upload files as base64 data-uris
Stars: ✭ 77 (+175%)
Mutual labels:  base64, data-uri
ember-await
Await component for Ember Applications. Resolve your data on demand, just when needed.
Stars: ✭ 54 (+92.86%)
Mutual labels:  loading
RAImagePicker
πŸ“Έ iMessage-like, Image Picker Controller Provides custom features.
Stars: ✭ 14 (-50%)
Mutual labels:  images
cloudinary-api
Shorter and lighter APIs for Cloudinary
Stars: ✭ 41 (+46.43%)
Mutual labels:  images
react-butterfiles
πŸ¦‹ Component for building file fields - from basic file inputs to drag and drop image galleries.
Stars: ✭ 44 (+57.14%)
Mutual labels:  images
resource-loader
Getting files out of a JAR or loading a shared library is difficult. We made it easy.
Stars: ✭ 15 (-46.43%)
Mutual labels:  loading
awesome-switcher
Switch clients in Awesome WM with the familiar preview functionality
Stars: ✭ 86 (+207.14%)
Mutual labels:  preview
cdn
πŸš€ ✈️ πŸš„ free CDN for everyone who wants to speed his website freely!πŸ˜„
Stars: ✭ 16 (-42.86%)
Mutual labels:  images
danbooru-ruby-grabber
Danbooru, Konachan, Behoimi (3dbooru) and Yandere images downloader
Stars: ✭ 39 (+39.29%)
Mutual labels:  images
ZXLoadingView
πŸ•ZXLoadingView is an iOS progress-activity
Stars: ✭ 14 (-50%)
Mutual labels:  loading
serde with
This crate provides custom de/serialization helpers to use in combination with serde's `with`-annotation and with the improved `serde_as`-annotation.
Stars: ✭ 392 (+1300%)
Mutual labels:  base64
zap
⚑ fast http framework for rust
Stars: ✭ 51 (+82.14%)
Mutual labels:  efficiency
Generative-Art
A selection of generative art scripts written in Python
Stars: ✭ 284 (+914.29%)
Mutual labels:  images
flexicon
SVG icon collection.
Stars: ✭ 23 (-17.86%)
Mutual labels:  base64
svelte-link-preview
Svelte port of @dhaiwat10/react-link-preview
Stars: ✭ 12 (-57.14%)
Mutual labels:  preview
pixel
A lightweight image loader for Android backed by Kotlin Coroutines.
Stars: ✭ 79 (+182.14%)
Mutual labels:  images
pretty-formula
A small Java library to parse mathematical formulas to LaTeX and display them as images
Stars: ✭ 29 (+3.57%)
Mutual labels:  images

Blur Up

CI Version

A tool that creates a small, optimized version of an input image and embeds it in an SVG file. The generated SVG file scales the integrated image up to its original dimensions and applies a blur filter to create a high quality preview of the original image. Such preview SVGs can be used as temporary substitutes for images that take longer to load.

Preview SVG Original Image
1082 Bytes 402.15 Kilobytes

Installation

npm install svg-blur-up

Usage

Command Line Interface (CLI)

The command line tool can be invoked using the blur-up command:

blur-up -i images/* -o previews -c configs/blur-up.json

You may provide a configuration via package.json or as a standalone file. If there is no configuration in package.json, the tool will look for a configuration file with the default name .blur-up.json in the current working directory. Please refer to the Options section for more information.

Option Shorthand Description
--input -i Specifies the input path or glob pattern
--output -o Specifies the output directory
--config -c Specifies an alternative config path

JavaScript API

The blurUp function returns a Promise.

import blurUp from "svg-blur-up";

// The input path must describe a single file.
blurUp("images/bg.jpg", "output/dir", options)
  .catch((e) => console.error(e));

Output

Each individual image will be wrapped in an SVG construct of the following form:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
  width="IMG_WIDTH" height="IMG_HEIGHT" viewBox="0 0 VIEW_WIDTH VIEW_HEIGHT" preserveAspectRatio="none">
  <filter id="blur" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
    <feGaussianBlur stdDeviation="STD_DEVIATION_X STD_DEVIATION_Y" edgeMode="duplicate" />
    <feComponentTransfer><feFuncA type="discrete" tableValues="1 1" /></feComponentTransfer>
  </filter>
  <image filter="url(#blur)" x="0" y="0" height="100%" width="100%" xlink:href="IMG_DATA_URI" />
</svg>

Note: The generated SVG file will be minified.

Options

Option Default Description
input - Can be a single path or an array of paths
output - A path that describes a file or directory
stdDeviationX 20 The blur strength along the X-axis
stdDeviationY 20 The blur strength along the Y-axis
width auto, 40 The width of the preview image
height auto The height of the preview image

The command line options --input and --output overwrite the respective fields in the configuration.

If only width or height is specified, the counter part will be calculated automatically to preserve the original aspect ratio. If both of these fields are undefined, width will be set to 40 and height will be adjusted accordingly.

.blur-up.json

{
  "input": "images/*.{bmp,jpg,png}",
  "output": "images/previews",
  "stdDeviationX": 10,
  "stdDeviationY": 10,
  "width": 30
}

package.json

{
  "blurUp": {
    "input": ["path/to/img/*.jpg", "other/path/*.png"],
    "output": "output/dir"
  }
}

blur-up.js

import blurUp from "svg-blur-up";

blurUp("path/to/img.jpg", "output/dir", {
  stdDeviationX: 5,
  stdDeviationY: 5
}).catch((e) => console.error(e));

Contributing

Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].