{"id":16660,"date":"2024-10-12T22:49:35","date_gmt":"2024-10-12T20:49:35","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=16660"},"modified":"2024-10-12T22:49:37","modified_gmt":"2024-10-12T20:49:37","slug":"wordcloud-woerterwolke-unter-linux-erstellen","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2024\/10\/12\/wordcloud-woerterwolke-unter-linux-erstellen\/","title":{"rendered":"Wordcloud \/ W\u00f6rterwolke unter Linux erstellen"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Man findet Wordclouds &#8211; also W\u00f6rterwolken immer wieder im Internet, dabei handelt es sich ganz einfach um Grafiken, die viele W\u00f6rter in verschiedenen Richtungen geschrieben anzeigen. Auch solche lassen sich unter Linux ganz einfach erstellen.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Die n\u00f6tige Software installieren<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Software wie \u00fcblich ganz einfach \u00fcber die Paket-Verwaltung durch das Paket &#8222;<strong>python3-wordcloud<\/strong>&#8222;. Am schnellsten als root auf dem Terminal mit den Befehlen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update\napt install python3-wordcloud<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Nutzen Sie eine andere Linux-Distribution, die das Paket nicht mitf\u00fchrt, installieren Sie diese Software ganz einfach \u00fcber das Python-Repository durch das Paket &#8222;<strong>wordcloud<\/strong>&#8220; mittels Pip.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Wordclouds erstellen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Die Software wird am Terminal genutzt, dies funktioniert jedoch ganz einfach. Als Erstes ben\u00f6tigen Sie eine Textdatei, in diese schreiben die alle W\u00f6rter, die im Bild sp\u00e4ter zu sehen sein sollen. Diese schreiben Sie ganz einfach durch ein Leerzeichen getrennt in eine Zeile &#8211; etwa:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Linux Debian Ubuntu openSUSE Fedora Mandriva Mageia<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In diese Datei k\u00f6nnen Sie so viele W\u00f6rter schreiben, wie Sie wollen. Ich nenne diese Textdatei jetzt ganz einfach &#8222;<strong>Textdatei.txt<\/strong>&#8222;, im Beispiel starte ich den Befehl ganz einfach auf dem Terminal im Verzeichnis, in dem auch die Datei liegt:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wordcloud_cli --text Textdatei.txt --imagefile wallpaper.png<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Mit der Option <code>--text<\/code> geben Sie also die Textdatei an, mit <code>--imagefile<\/code> die Grafikdatei, die entstehen soll. Ohne weitere Optionen wird eine Grafikdatei mit der Gr\u00f6\u00dfe von 400&#215;200 Pixel:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"200\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper.png\" alt=\"\" class=\"wp-image-16661\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper.png 400w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper-150x75.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper-300x150.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit den Optionen <code>--width<\/code> und <code>--height<\/code> k\u00f6nnen wir die Gr\u00f6\u00dfe in Pixel angeben, Beispiel:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wordcloud_cli --text Textdatei.txt --width 800 --height 600 --imagefile wallpaper1.png<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper1.png\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper1.png\" alt=\"\" class=\"wp-image-16663\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper1.png 800w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper1-150x113.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper1-300x225.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper1-768x576.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit der Option <code>--fontfile<\/code> k\u00f6nnen Sie eine andere Schrift angeben, hierzu geben Sie ganz einfach etwa den Pfad zu einer <code>.ttf<\/code>-Datei an.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mit <code>--background<\/code> k\u00f6nnen Sie eine andere Hintergrundfarbe angeben &#8211; hierzu nutzen Sie HTML-<a href=\"https:\/\/www.farb-tabelle.de\/de\/farbtabelle.htm\" target=\"_blank\" rel=\"noreferrer noopener\">Farbcodes<\/a> in Hex. Also etwa:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wordcloud_cli --text Textdatei.txt --background '#FF4040' --imagefile wallpaper2.png<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Den Farbcode stellen Sie dabei unter Anf\u00fchrungszeichen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2.png\" rel=\"lightbox-2\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"200\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2.png\" alt=\"\" class=\"wp-image-16665\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2.png 400w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-150x75.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-300x150.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Sie k\u00f6nnen auch mit Masken arbeiten, um der Wordcloud eine Form zu geben. Hierbei sollte es sich um eine PNG-Datei mit wei\u00dfem Hintergrund handeln, die Form wird schwarz &#8211; ein Beispiel:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin.png\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1024x512.png\" alt=\"\" class=\"wp-image-16666\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1024x512.png 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-150x75.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-300x150.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-768x384.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Das Bild selbst (also die Maske) sollte so gro\u00dfe sein, wie die zu erstellende Grafik &#8211; die Grafik geben Sie anschlie\u00dfend mit der Option <code>--mask<\/code> an, im Beispiel lasse ich die Hintergrundfarbe wieder weg:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wordcloud_cli --text Textdatei.txt --mask pinguin.png --imagefile wallpaper2.png<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-1.png\" rel=\"lightbox-4\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-1-1024x512.png\" alt=\"\" class=\"wp-image-16667\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-1-1024x512.png 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-1-150x75.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-1-300x150.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-1-768x384.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper2-1.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Geben Sie hier eine sinnvolle Hintergrundfarbe an, etwa <code>white<\/code> &#8211; sieht die Geschichte nat\u00fcrlich gleich anders aus:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wordcloud_cli --text Textdatei.txt --background white --mask pinguin.png --imagefile wallpaper3.png<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3.png\" rel=\"lightbox-5\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1024x512.png\" alt=\"\" class=\"wp-image-16668\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1024x512.png 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-150x75.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-300x150.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-768x384.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit <code>--contour_width<\/code> in Pixel setzen Sie eine Umrandung:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wordcloud_cli --text Textdatei.txt --background white --mask pinguin.png --contour_width 3 --imagefile wallpaper3.png<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1.png\" rel=\"lightbox-6\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1-1024x512.png\" alt=\"\" class=\"wp-image-16669\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1-1024x512.png 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1-150x75.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1-300x150.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1-768x384.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-1.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Sie k\u00f6nnen die Maske nat\u00fcrlich auch ausbauen &#8211; etwa so (hier nur ganz einfach):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1.png\" rel=\"lightbox-7\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1-1024x512.png\" alt=\"\" class=\"wp-image-16670\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1-1024x512.png 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1-150x75.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1-300x150.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1-768x384.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/pinguin-1.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-2.png\" rel=\"lightbox-8\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-2-1024x512.png\" alt=\"\" class=\"wp-image-16671\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-2-1024x512.png 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-2-150x75.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-2-300x150.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-2-768x384.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/10\/wallpaper3-2.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Auf weitere Ideen k\u00f6nnte Sie <a href=\"https:\/\/amueller.github.io\/word_cloud\/auto_examples\/single_word.html\" target=\"_blank\" rel=\"noreferrer noopener\">Wordcloud<\/a> bringen.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Man findet Wordclouds &#8211; also W\u00f6rterwolken immer wieder im Internet, dabei handelt es sich ganz einfach um Grafiken, die viele W\u00f6rter in verschiedenen Richtungen geschrieben anzeigen. Auch solche lassen sich unter Linux ganz einfach erstellen. Die n\u00f6tige Software installieren Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Software wie \u00fcblich ganz einfach \u00fcber die Paket-Verwaltung [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":16671,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51,657],"tags":[52,427,476],"class_list":["post-16660","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bildbearbeitung","category-grafik","tag-bildbearbeitung","tag-grafik","tag-grafik-design"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/16660","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=16660"}],"version-history":[{"count":3,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/16660\/revisions"}],"predecessor-version":[{"id":16672,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/16660\/revisions\/16672"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/16671"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=16660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=16660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=16660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}