Download the PHP package humanmade/gaussholder without Composer

On this page you can find all versions of the php package humanmade/gaussholder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gaussholder

Gaussholder
Fast and lightweight image previews, using Gaussian blur.
A Human Made project. Maintained by @rmccue.

Gaussholder is an image placeholder utility, generating accurate preview images using an amazingly small amount of data.

That's a 800 byte preview image, for a 109 kilobyte image. 800 bytes still too big? Tune the size to your liking in your configuration.

Please note: This is still in development, and we're working on getting this production-ready, so things might not be settled yet. In particular, we're still working on tweaking the placeholder size and improving the lazyloading code. Avoid using this in production.

How does it work?

Gaussholder is inspired by Facebook Engineering's fantastic post on generating tiny preview images. Gaussholder takes the concepts from this post and applies them to the wild world of WordPress.

In a nutshell, Gaussholder takes a Gaussian blur and applies it to an image to generate a preview image. Gaussian blurs work as a low-pass filter, allowing us to throw away a lot of the data. We then further reduce the amount of data per image by removing the JPEG header and rebuilding it on the client side (this eliminates ~800 bytes from each image).

We further reduce the amount of data for some requests by lazyloading images.

How do I use it?

Gaussholder is designed for high-volume sites for seriously advanced users. Do not install this on your regular WP site.

  1. Download and activate the plugin from this repo.
  2. Select the image sizes to use Gaussholder on, and add them to the array on the gaussholder.image_sizes filter.
  3. If you have existing images, regenerate the image thumbnails.

Your filter should look something like this:

The keys are registered image sizes (plus full for the original size), with the value as the desired blur radius in pixels.

By default, Gaussholder won't generate any placeholders, and you need to opt-in to using it. Simply filter here, and add the size names for what you want generated.

Be aware that for every size you add, a placeholder will be generated and stored in the database. If you have a lot of sizes, this will be a lot of data.

By default Gaussholder is initialized with the DOMContentLoaded event. Should you need to reinitialize Gaussholder after the page had loaded, this can be achieved with GaussHolder();.

Blur radius

The blur radius controls how much blur we use. The image is pre-scaled down by this factor, and this is really the key to how the placeholders work. Increasing radius decreases the required data quadratically: a radius of 2 uses a quarter as much data as the full image; a radius of 8 uses 1/64 the amount of data. (Due to compression, the final result will not follow this scaling.)

Be careful tuning this, as decreasing the radius too much will cause a huge amount of data in the body; increasing it will end up with not enough data to be an effective placeholder.

The radius needs to be tuned to each size individually. Facebook uses about 200 bytes of data for their placeholders, but you may want higher quality placeholders. There's no ideal radius, as you simply want to balance having a useful placeholder with the extra time needed to process the data on the page.

Gaussholder includes a CLI command to help you tune the radius: pick a representative attachment or image file and use wp gaussholder check-size <id_or_image> <radius>. Adjust the radius until you get to roughly 200B, then check against other attachments to ensure they're in the ballpark.

Note: changing the radius requires regenerating the placeholder data. Run wp gaussholder process-all --regenerate after changing radii or adding new sizes.

License

Gaussholder is licensed under the GPLv2 or later.

Gaussholder uses StackBlur, licensed under the MIT license.

See LICENSE.md for further details.

Credits

Created by Human Made for high volume and large-scale sites.

Written and maintained by Ryan McCue. Thanks to all our contributors. (Thanks also to fellow humans Matt and Paul for the initial placeholder code.)

Gaussholder is heavily inspired by Facebook Engineering's post, and would not have been possible without it. In particular, the techniques of downscaling before blurring and extracting the JPEG header are particularly novel, and the key to why Gaussholder exists.

Interested in joining in on the fun? Join us, and become human!


All versions of gaussholder with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
composer/installers Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package humanmade/gaussholder contains the following files

Loading the files please wait ....