-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Transparent images #12
Comments
@bradydowling what do you mean by transparent elements or transparent background? Can you give me an example? Eventual a sketch or something to understand it better. |
Ya, for example, here's an image I created with primitive: Note the transparent background. Primitive handles this by allowing the user to specify a background color, including the alpha. And in this next one, many of the shapes have only partial opacity. |
I was thinking about the possible solutions, but one more thing I want to clarify: since this tool is based on the delaunay triangulation this means that the triangles are computed by calculating the average cell color. Because in certain cases we don't have an image with a fully opaque or transparent backround this means we need to detect the most dominant color as a background color and apply the desired color as a background. Can you show me what you got and what is the desired effect? |
Forgive me if I'm misunderstanding how this works but I'll give it my best shot.
Do you just mean the background could be semi-transparent (e.g. alpha of 0.5)? What if you allowed the user to manually specify the background color so detection doesn't need to happen? Then each triangle can be placed atop that background.
I believe you're looking for the source image for both of those images I produced above. This is it: Then with that, I specified the base background color for the image that is produced. |
I'll look into it to see if it's possible without major changes. |
@bradydowling I've integrated the requested features. Please pull out the latest code and give it a try. As an example here is how it looks like. I have also updated the documentation. |
Awesome! It looks like it's working with some images. This one doesn't seem to be working. Here's the image: And here's the command I'm running as well as the output:
I get the same thing when passing |
I was searching for the reason, but haven't found yet, but definitely it's related to how the image is encoded, because if i'm re-saving in Photoshop then it's working. I'm still investigating. |
Very interesting. I had tried a couple things troubleshooting but had
considered that, good thought.
…On Thu, Apr 16, 2020, 4:54 AM Endre Simo ***@***.***> wrote:
I was searching for the reason, but haven't found yet, but definitely it's
related to how the image is encoded, because if i'm re-saving in Photoshop
then it's working. I'm still investigating.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABS4AU3TX2YHUVZ7ZRWMBQDRM3BULANCNFSM4MCJMIXQ>
.
|
That looks more blobby than triangulated. I guess should just fix the source image I have and then rerun it to see if that will produce a nice image. After pulling it's producing the same thing that you shared above. I believe you can resolve this now, thank you for your work on it! 🙏 |
This has to do with the type of the underlying image and since it has an uniform single color the tool fills up the produced inner triangles with the same color. You can prove yourself if you are running the following command: triangle -in ~/Desktop/79342830-a0ed0380-7efb-11ea-83a0-b4e6b8971864.png -out ~/Desktop/triangle.png -bg="#ff000000" -stroke=0 -wireframe=0 -gray=0 -sobel=5 -blur=4 -max=1500 -wireframe=2 -stroke=1 This is the output it generates: |
If you don't mind I'll close this issue. You can reopen it at any time if that's the case. |
Is there a way to make images with transparent elements or a transparent background?
The text was updated successfully, but these errors were encountered: