Closed ZmjbS closed 7 years ago
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.
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).
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.
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.