eink-radiator-image-source-image

command module
v0.2.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 1 Imported by: 0

README

eInk Radiator Image Source: Image

CI

Generates an image from an existing image.

image generate --config config.json --height 300 --width 400

Configuration

The configuration is the image source, which must be a publically accessible URL, the scaling algorithm (see below) and the background color (if required).

field default required description
source Yes The URL to the image
scale Yes Algorithm to use when resizing the image to the desired resolution
background.color white No The color of the background (used when contained images are a different resolution ratio)

Possible options for scale:

  • resize - Resize the image to fit the desired resolution. May lead to distortions.
  • contain - Resize the image so the whole image fits inside the new resolution. May show some background, which will use the background.color configuration.
  • cover - Resize the image so the smallest dimension fits inside the new resolution frame. May crop out some of the original image.

Examples

A resized image
---
source: https://github.com/petewall/eink-radiator-image-source-image/raw/main/test/dog1.jpg
scale: resize

An image that has been resized from the original

A covered image
---
source: https://github.com/petewall/eink-radiator-image-source-image/raw/main/test/dog3.jpg
scale: cover

An image that has been scaled so it fits the new size

A contained image
{
    "source": "https://github.com/petewall/eink-radiator-image-source-image/raw/main/test/dog2.jpg",
    "scale": "contain",
    "background": {
        "color": "green"
    }
}

An image that has been scaled so its contained in the new size

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internalfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
pkg
pkgfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL