Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG images don't have any contour lines #694

Open
varac opened this issue Oct 20, 2022 · 1 comment · May be fixed by #759
Open

SVG images don't have any contour lines #694

varac opened this issue Oct 20, 2022 · 1 comment · May be fixed by #759

Comments

@varac
Copy link

varac commented Oct 20, 2022

Description

I'm trying to produce a masked SVG image for better quality, but the resulting image lack the contour line.

Steps/Code to Reproduce

Use this example to create the svg image

from PIL import Image
import numpy as np
from wordcloud import WordCloud

with open('examples/alice_license.txt', encoding='UTF8') as f:
    text = f.read()

mask = np.array(Image.open("examples/alice_mask.png"))

wordcloud = WordCloud(
    background_color="white",
    mask=mask).generate(text)

svg_image = wordcloud.to_svg(embed_font=True)
with open("alice.svg", "w+", encoding='UTF8') as f:
    f.write(svg_image)

Expected Results

An SVG image with contour line.

Actual Results

see this image produced with the example code above:

alice

Versions

Linux-5.19.0-76051900-generic-x86_64-with-glibc2.35
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
NumPy 1.23.4
matplotlib 3.6.1
wordcoud 1.8.2.2
@amueller
Copy link
Owner

amueller commented Jun 6, 2023

hm yes, that's not implemented yet, I think. A pull request would be appreciated.

@sans-dev sans-dev linked a pull request Feb 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants