import numpy as np
from PIL import Image
from PIL import ImageOps
from wordcloud import STOPWORDS
from wordcloud import WordCloud as wc
import matplotlib.pyplot as plt
import os
# Step 1: Change the current working directory to the directory of the script being run
os.chdir(os.path.dirname(os.path.abspath(file)))
# Step 2.1: Load your image
mask = np.array(Image.open("image.png"))
# Step 5: Clean your text data
text = '''
The software supports various image formats, including RAW, and offers fast thumbnail preview, zoomable grid preview of thumbnails, and display of exif information. It allows for a framless view and change of transparency of windows. It also offers file filtering, searching, and sorting, improved anti-aliasing, hiding of menubar and toolbar, slideshow image information, play/pause with user defined time interval, and adjustable background color. The software also enables image editing such as cropping, resizing, pseudo color function, color adjustments, multi page TIFF export, rotating images, drag and drop images, automatically saving screenshots, deleting/renaming images, creating mosaic image, and setting wallpaper. Additionally, the software offers viewer synchronization for multiple instances, synchronized zooming and panning, synchronized next/previous file, overlay of two or more instances with changing opacity, and arrangement of synchronized instances. It also enables synchronization of multiple instances in the LAN and sending of images over LAN connection. Finally, the software supports various file extensions for reading and writing with comments.
your text data'''
cleaned_text = " ".join([word for word in text.split() if word not in STOPWORDS])
# Step 5: Generate the wordcloud using the cleaned text and the mask.png as the shape
wordcloud = wc(background_color="white", max_words=2000, mask=mask, contour_width=3, contour_color='steelblue').generate(cleaned_text)
# Step 6: Display the wordcloud
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
from PIL import Image
from PIL import ImageOps
from wordcloud import STOPWORDS
from wordcloud import WordCloud as wc
import matplotlib.pyplot as plt
import os
# Step 1: Change the current working directory to the directory of the script being run
os.chdir(os.path.dirname(os.path.abspath(file)))
# Step 2.1: Load your image
mask = np.array(Image.open("image.png"))
# Step 5: Clean your text data
text = '''
The software supports various image formats, including RAW, and offers fast thumbnail preview, zoomable grid preview of thumbnails, and display of exif information. It allows for a framless view and change of transparency of windows. It also offers file filtering, searching, and sorting, improved anti-aliasing, hiding of menubar and toolbar, slideshow image information, play/pause with user defined time interval, and adjustable background color. The software also enables image editing such as cropping, resizing, pseudo color function, color adjustments, multi page TIFF export, rotating images, drag and drop images, automatically saving screenshots, deleting/renaming images, creating mosaic image, and setting wallpaper. Additionally, the software offers viewer synchronization for multiple instances, synchronized zooming and panning, synchronized next/previous file, overlay of two or more instances with changing opacity, and arrangement of synchronized instances. It also enables synchronization of multiple instances in the LAN and sending of images over LAN connection. Finally, the software supports various file extensions for reading and writing with comments.
your text data'''
cleaned_text = " ".join([word for word in text.split() if word not in STOPWORDS])
# Step 5: Generate the wordcloud using the cleaned text and the mask.png as the shape
wordcloud = wc(background_color="white", max_words=2000, mask=mask, contour_width=3, contour_color='steelblue').generate(cleaned_text)
# Step 6: Display the wordcloud
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()