Hello i took a picture with my camera :a drawing of a square frame on a white paper; i'm trying to convert the white to transparent and keep the black color frame.
So i started making 1 palette with only 2 colors to make the colors uniform and 1 palette to add the transparency
ffmpeg -f lavfi -i "color=color=white:100x100" -f lavfi -i "color=color=black:100x100" -filter_complex "[0][1]hstack" -frames:v 1 blackwhite.png`
ffmpeg -i blackwhite.png -filter_complex "[0]split[a][b];[a]palettegen[pal1];[b]palettegen=reserve_transparent=on:transparency_color=white[pal2]" -map [pal1] palette1.png -map [pal2] palette2.png
then i mapped the image png of the frame to convert the white to transparent and overlayed the result to a red background
ffmpeg -i image.png -i palette1.png -i palette2.png -i background.png -filter_complex "[0:v][1:v]paletteuse=dither=bayer[a],[a]split[a1][a2];[a1][2:v]paletteuse=alpha_threshold=128[c];[3:v][c]overlay[d]" -map [a2] -c:v png out.png -map [d] -c:v png out1.png
the png mapped to the first palette (as a test) comes as it should be, pure black and white,the second comes with no transparency at all and covers the background what am i doing wrong?