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

Transparency not working #6

Closed
ZmjbS opened this issue Jun 27, 2016 · 3 comments
Closed

Transparency not working #6

ZmjbS opened this issue Jun 27, 2016 · 3 comments
Assignees

Comments

@ZmjbS
Copy link

ZmjbS commented Jun 27, 2016

I didn't find anything about transparent colours in the usage docs. It would be great to be able to define the colours and background as RGBA values as opposed to RGB.

@azaghal
Copy link
Owner

azaghal commented Jun 27, 2016

Hm... Thanks for reporting. I'll try to have a look at it and see what can be done. Definitively it is not possible to specify transparency at the moment. Might be time to do some small coding to make a new release.

@azaghal
Copy link
Owner

azaghal commented Nov 30, 2016

Ok, just had a very, very quick look at this, and it seems it will be a very simple fix. In fact, I think all that is needed to support transparency will be 1 character :)

So, this:

image = Image.new("RGB", (width + padding[2] + padding[3], height + padding[0] + padding[1]), background)

Would need to be changed to this:

image = Image.new("RGBA", (width + padding[2] + padding[3], height + padding[0] + padding[1]), background)

Afterwards it should be possible to specify foreground via, say, "rgba(255,255,255,0)" or "#ffffff00".

I'll look into this during weekend (want to have a look at another issue while at it for more formats).

@azaghal azaghal self-assigned this Dec 3, 2016
@azaghal
Copy link
Owner

azaghal commented Dec 3, 2016

Fixed, including some docs + test updates. Using RGBA will slightly increase image sizes, but I don't think it's worth it to add more logic around (to pick when to choose which one). Will be part of Pydenticon 0.3 release later today.

@azaghal azaghal closed this as completed Dec 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants