{"id":19326,"date":"2025-06-21T21:55:13","date_gmt":"2025-06-21T19:55:13","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=19326"},"modified":"2025-06-21T21:55:16","modified_gmt":"2025-06-21T19:55:16","slug":"rembg-hintergruende-unter-linux-mit-ki-entfernen","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2025\/06\/21\/rembg-hintergruende-unter-linux-mit-ki-entfernen\/","title":{"rendered":"rembg &#8211; Hintergr\u00fcnde unter Linux mit KI entfernen"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ich habe f\u00fcr diesen Beitrag einige Minuten geflucht, muss ich zugeben. Aber &#8211; schlussendlich lassen sich mit <strong>rembg<\/strong> Hintergr\u00fcnde von Bildern mit KI unter Linux entfernen, also ohne jegliche Eingabe und Modifikationen und Wissen.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">rembg installieren<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Als Erstes ben\u00f6tigen Sie die Software <strong>rembg<\/strong> aus dem <a href=\"https:\/\/linux-bibel.at\/index.php\/2023\/09\/09\/python-software-unter-linux-aus-dem-python-package-index-installieren\/\" data-type=\"post\" data-id=\"1910\">Python Repository<\/a>, unter Debian und Co. installiere ich dazu \u00fcber die Paket-Verwaltung das Paket &#8222;<strong>pipx<\/strong>&#8220; &#8211; am schnellsten als root auf dem Terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update\napt install pipx<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Anschlie\u00dfend l\u00e4sst sich \u00fcber Pipx die eigentliche ben\u00f6tigte Software installieren &#8211; als normaler Benutzer am Terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pipx install \"rembg&#91;cpu,cli]\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Haben Sie noch keine Python-Software aus dem Repo installiert, f\u00fchren Sie auf der Bash (<em>nicht Zsh<\/em>) folgenden Befehl aus:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pipx ensurepath<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">rembg nutzen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Die Software wird auf dem Terminal, auf der Bash genutzt &#8211; ich nutze Zsh, also wechsle ich erst auf dem Terminal auf die Bash:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bash<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Jetzt habe ich beispielsweise in einem Verzeichnis die Datei &#8222;robert.jpg&#8220;, in dieser m\u00f6chte ich den Hintergrund entfernen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/robert.jpg\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" width=\"704\" height=\"1024\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/robert-704x1024.jpg\" alt=\"\" class=\"wp-image-19327\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/robert-704x1024.jpg 704w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/robert-103x150.jpg 103w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/robert-206x300.jpg 206w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/robert-768x1117.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/robert.jpg 792w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit der Option &#8222;<strong>i<\/strong>&#8220; wird die Eingabedatei angegeben, also das Original, dann folgt die Ausgabedatei &#8211; das Original wird nicht ver\u00e4ndert. Im Beispiel will ich die Ausgabe ganz einfach &#8222;<strong>1.jpg<\/strong>&#8220; nennen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rembg i robert.jpg 1.jpg<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Beim ersten Einsatz l\u00e4dt <strong>rembg<\/strong> eine zus\u00e4tzliche Bibliothek herunter &#8211; diese nennt sich &#8222;<em>\/home\/username\/.u2net\/u2net.onnx<\/em>&#8222;. Das Ergebnis:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/1.png\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" width=\"704\" height=\"1024\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/1-704x1024.png\" alt=\"\" class=\"wp-image-19328\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/1-704x1024.png 704w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/1-103x150.png 103w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/1-206x300.png 206w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/1-768x1117.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/06\/1.png 792w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Fast perfekt \ud83d\ude42<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mehr dazu auf <a href=\"https:\/\/github.com\/danielgatis\/rembg\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>.<\/p>\n<div class=\"pld-like-dislike-wrap pld-custom\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir\" data-post-id=\"19326\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Hoch.png\" alt=\"Gef\u00e4llt mir\" \/>\r\n            <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">6    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir nicht\" data-post-id=\"19326\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Runter.png\" alt=\"Gef\u00e4llt mir nicht\" \/>\r\n            <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Ich habe f\u00fcr diesen Beitrag einige Minuten geflucht, muss ich zugeben. Aber &#8211; schlussendlich lassen sich mit rembg Hintergr\u00fcnde von Bildern mit KI unter Linux entfernen, also ohne jegliche Eingabe und Modifikationen und Wissen. rembg installieren Als Erstes ben\u00f6tigen Sie die Software rembg aus dem Python Repository, unter Debian und Co. installiere ich dazu \u00fcber [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":19328,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51,628],"tags":[52,698],"class_list":["post-19326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bildbearbeitung","category-kuenstliche-intelligenz","tag-bildbearbeitung","tag-kuenstliche-intelligenz"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/19326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=19326"}],"version-history":[{"count":1,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/19326\/revisions"}],"predecessor-version":[{"id":19329,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/19326\/revisions\/19329"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/19328"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=19326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=19326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=19326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}