AviSynth / AviSynthPlus

AviSynth with improvements
http://avs-plus.net
930 stars 74 forks source link

AddBorders with rgba color value #380

Closed seiya-git closed 2 weeks ago

seiya-git commented 6 months ago

Hello. AddBorders accept only rgb value or rgba accepted too?

https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/addborders.html there is only color but no colors value

qyot27 commented 6 months ago

Yes, RGBA is accepted too, at least if you use four-byte hex values instead of the three that colors_rgb.avsi defines for the color presets.

$48D1CC is medium turquoise, standard RGB $0048D1CC is medium turquoise, RGBA with the alpha channel invisible (in ffplay or mpv, this will appear black or as the checkerboard transparency placeholder) $FF48D1CC is medium turquoise, RGBA with the alpha channel visible ()

left=ColorBars(pixel_type="RGBP").AddAlphaPlane().Crop(0,0,-320,0).AddBorders(0,32,0,32,color=$0048D1CC)
right=ColorBars(pixel_type="RGBP").AddAlphaPlane().Crop(320,0,0,0).AddBorders(0,32,0,32,color=$FF48D1CC)
StackHorizontal(left,right)

(Note: I have not tested this on a big endian system to verify whether the hex value is interpreted the same way, or if I have tested it, I forgot whether it understands it as the same color or whether you have to use byte-swapped values)