Skip to content

Object Image

XOYZ69 edited this page Sep 6, 2023 · 3 revisions

The image object is used to display images on to your card. This is not limited to locally stored images and allows users to implement images from the web to create dynamic objects.

Example

The image object looks as the following:

{
    "type":             "image",
    "desc":             "Some Image",
    "x":                0,
    "y":                "0%",
    "height":           50,
    "width":            50,
    "anchor":           "lt",
    "image_path":       "data/example/gamecard_simple/icons8-google-scholar-512.png",
    "logic":            null,
    "blend_mode":       "basic",
    "opacity":          1.0,
    "use_alpha":        false,
    "use_alpha_v2":     false,
    "filter":           null
}

Parameters

Parameter Description Default Value
type Defines the type of the object you are using and is mandatory for the interpreter to work. -
desc Sets a description for your object that can help your differentiate between different objects or can explain what this specific object does. This parameter has no further impact on your design. "Some Image"
x Sets the x coordinate of your object in pixel. Depending on your anchor setting. 0
y Sets the y coordinate of your object in pixel. Depending on your anchor setting. 0
height Sets the height of the ellipse in pixel. 50
width Sets the width of the ellipse in pixel. 50
anchor Sets the anchor on how the image is being placed. Possible anchors are:
- lt: Left top
- mm: Middle middle
- rb: Right bottom
- rt: Right top
The missing anchor types will be added in the future
lt
image_path Sets the path to the image which should be displayed. This can also be an url if it is available through a public link. see json
blend_mode Applies a blend mode to the image on how to overlay the image on top of the card.
The current available blend modes are:
- basic: The standard way which will just put the image on the card.
- substract: The image is being substracted from the underlying image with a negative number resulting in the r/g/b value 0.
"basic"
opacity !! Currently usupported
Sets the opactity of the image.
1.0
use_alpha !! Experimental Feature
This parameter implements the alpha feature to ignore the transparent pixels from image formats like png.
false
use_alpha_v2 !! Experimental Feature
This parameter implements the alpha v2 feature to ignore the transparent pixels from image formats like png. Can only be active while the the "use_alpha" feature is not enabled.
false
filter Experimental Feature
Apply a filter to your image. To use multiple filter just insert a comma between them like this: "cut,gradient"
sharpen Apply the sharpen filter
detail Apply the detail filter
edge Apply the edge filter
find_edges Apply the find_edges filter
gradient Apply the gradient filter to fade out the image.
This fade can be side configured.
(Currently only bottom side works)
cut Cut off image from one side by x pixels.
null
filter_config Experimental Feature
Set filter parameters for your selected filters. It is important to set the filter config in the same oder and index as the filters.
For example the filters "cut,gradient" need the filter config like so:
"filter_config": [ { "side": "top", "length": 100 }, { "direction": "bottom", "length": 700 } ]
For filters with no config there needs to be an empty index holder if there is any config required filter later in the array. For the filter "sharpen,gradient" the filter config needs to look like this:
"filter_config": [ {}, { "direction": "bottom", "length": 700 } ]
null
logic Apply logic for to an object. For more information on how logic works look into the logic section. null

Clone this wiki locally