20.7 u2net cutout with jpg output

20211015

If you choose to save the result as a jpg, using --jpg, be aware that as an RGB format jpg has no transparency layer. A png file uses an RGBA format and thus supports transparency.

ml cutout u2net ~/.mlhub/rembg/examples/animal-1.jpg --view --jpg

This will save the cutout to animal-1_cutout.jpg and during the process the following popup appears (because of --view).

You can convert a jpg to png adding transparency using convert from imagemagick as explained in the GNU/Linux Desktop Survival Guide. The command line, choosing a 5% fuzz factor for the blackness, is:

convert -transparent black -fuzz 5% animal-1_cutout.jpg animal-1_cutout.png


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0