Upload a PNG mask from your LeafMachine3 output to generate a 3D file.
Green usually separates veins best on a pressed leaf: chlorophyll absorbs red and blue, so the lamina is brightest — and most even — in green.
A vein is only a few grey levels darker than the tissue beside it, but the lamina's own brightness varies far more across the leaf — so what gets thresholded is the difference from a LOCAL average, not the grey value. Set this to about twice the widest vein you want to keep.
Probes the image with a straight line in several directions and keeps what survives. Blotches and areole texture die; veins live. It earns its keep at a LOW threshold — at a high one it mostly deletes the secondary veins.
Otsu splits the enhanced image at the level that best separates two populations. It is a good starting point, but it always finds a split — even on an image with no veins in it.
A vein thinner than the nozzle will not print. Thickening every stroke evenly is the cheapest way to keep the fine venation.
The leaf's own outline is the strongest dark line in the photo. Insetting the search keeps it from being traced as a vein.