add insert_image and add_bleed_edge functions

This commit is contained in:
GenevensiS
2025-07-12 01:14:15 +02:00
parent e4e5b6840e
commit 0e4c91b940
7 changed files with 258 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
Function: add_bleed_edge
--Usage--
> add_bleed_edge(input: image, horizontal_size: number, vertical_size: number, background_color: color)
Add a crude print bleed edge around an image.
The sizes are given in percentages of the image size, so @horizontal_size: 1@ makes the image three times as large by putting a bleed edge of 100% on both sides.
--Parameters--
! Parameter Type Description
| @input@ [[type:image]] Image that needs a print bleed edge
| @horizontal_size@ [[type:double]] Size of the bleed edge on the sides, in percentage of the image width. Optional, defaults to 0.048
| @vertical_size@ [[type:double]] Size of the bleed edge on the top and bottom, in percentage of the image height. Optional, defaults to 0.037
| @background_color@ [[type:color]] Background color, optional, defaults to transparent
+1 -1
View File
@@ -9,7 +9,7 @@ The border size is given in percentages of the image size, so @border_size: 1@ m
--Parameters--
! Parameter Type Description
| @input@ [[type:image]] Image to enlarge
| @border_size@ [[type:double]] Amount of border to add
| @border_size@ [[type:double]] Amount of border to add, in percentage of the image
--Examples--
> enlarge(input: "image1.png", border_size: 0.1) == [[Image]]
+1
View File
@@ -89,6 +89,7 @@ These functions are built into the program, other [[type:function]]s can be defi
| [[fun:recolor_image]] Change the colors of an image to match the font color.
| [[fun:resize_image]] Stretch or squeeze an image to a given height and width.
| [[fun:enlarge]] Enlarge an image by putting a border around it.
| [[fun:add_bleed_edge]] Add a crude print bleed edge around an image.
| [[fun:crop]] Crop an image, giving only a small subset of it.
| [[fun:flip_horizontal]] Flip an image horizontally.
| [[fun:flip_vertical]] Flip an image vertically.