png¶
Renders PNG images.
Options¶
All of these options support arrays and singleton expansion (except for range). See Squib Thinks in Arrays for deeper explanation.
- file
default:
''
(empty string)file(s) to read in. As in Squib Thinks in Arrays, if this a single file, then it’s use for every card in range. If the parameter is an Array of files, then each file is looked up for each card. If any of them are nil or ‘’, nothing is done for that card.
- x
default:
0
the x-coordinate to place, relative to the upper-left corner of the card and moving right as it increases. Supports Unit Conversion and XYWH Shorthands.
- y
default:
0
the y-coordinate to place, relative to the upper-left corner of the card and moving downward as it increases. Supports Unit Conversion and XYWH Shorthands.
- width
default:
:native
the pixel width that the image should scale to. Supports Unit Conversion. When set to
:native
, uses the DPI and units of the loaded SVG document. Using:deck
will scale to the deck width. Using:scale
will use theheight
to scale and keep native the aspect ratio. Scaling PNGs is not recommended for professional-looking cards, and up-scaling a PNG will throw a warning in the console (see Configuration Options). Supports Unit Conversion and XYWH Shorthands.- height
default:
:native
the pixel height that the image should scale to. Supports Unit Conversion. When set to
:native
, uses the DPI and units of the loaded SVG document. Using:deck
will scale to the deck height. Using:scale
will use thewidth
to scale and keep native the aspect ratio. Scaling PNGs is not recommended for professional-looking cards, and up-scaling a PNG will throw a warning in the console (see Configuration Options). Supports Unit Conversion and XYWH Shorthands.- alpha
default: 1.0
the alpha-transparency percentage used to blend this image. Must be between
0.0
and1.0
- blend
default:
:none
the composite blend operator used when applying this image. See Blend Modes at http://cairographics.org/operators. The possibilties include :none, :multiply, :screen, :overlay, :darken, :lighten, :color_dodge, :color_burn, :hard_light, :soft_light, :difference, :exclusion, :hsl_hue, :hsl_saturation, :hsl_color, :hsl_luminosity. String versions of these options are accepted too.
- mask
default:
nil
Accepts a color (see Specifying Colors & Gradients). If specified, the image will be used as a mask for the given color/gradient. Transparent pixels are ignored, opaque pixels are the given color. Note: the origin for gradient coordinates is at the given x,y, not at 0,0 as it is most other places.
- angle
default:
0
Rotation of the in radians. Note that this rotates around the upper-left corner, making the placement of x-y coordinates slightly tricky.
- crop_x
default:
0
Crop the loaded image at this x coordinate. Supports Unit Conversion.
- crop_y
default:
0
Crop the loaded image at this y coordinate. Supports Unit Conversion.
- crop_corner_radius
default:
0
Radius for rounded corners, both x and y. When set, overrides crop_corner_x_radius and crop_corner_y_radius. Supports Unit Conversion.
- crop_corner_x_radius
default:
0
x radius for rounded corners of cropped image. Supports Unit Conversion.
- crop_corner_y_radius
default:
0
y radius for rounded corners of cropped image. Supports Unit Conversion.
- crop_width
default:
:native
Width of the cropped image. Supports Unit Conversion.
- crop_height
default:
:native
Height of the cropped image. Supports Unit Conversion.
- flip_horizontal
default:
false
Flip this image about its center horizontally (i.e. left becomes right and vice versa).
- flip_vertical
default:
false
Flip this image about its center vertical (i.e. top becomes bottom and vice versa).
- range
default:
:all
the range of cards over which this will be rendered. See Using range to specify cards
- layout
default:
nil
entry in the layout to use as defaults for this command. See Layouts are Squib’s Best Feature.