Home > other >  PIL will be cutting fit into two PNG image
PIL will be cutting fit into two PNG image

Time:03-31

Have two same size, and the background transparent picture t1. The PNG and m1. PNG, m1 only black area, other transparent, use putalpha, m1 correspond black area on the t1 minus, the result is the m1 transparent areas for processing in t1 is white, not transparent, what method can achieve a goal,
 img=Image. Open (" t1. PNG ") 
Alpha=Image. Open (" m2. PNG ")
Alpha=alpha. Convert (" L ")
Img. Putalpha (alpha)
Img. Save (" xx. PNG, "' PNG ')
  • Related