CSS hexadecimal RGBA?

The CSS Color Module Level 4 will probably support 4 and 8-digit hexadecimal RGBA notation! Three weeks ago (18th of December 2014) the CSS Color Module Level 4 editor’s draft was submitted to the CSS W3C Working Group. Though in a state which is heavily susceptible to change, the current version of the document implies … Read more

Convert RGBA PNG to RGB with PIL

Here’s a version that’s much simpler – not sure how performant it is. Heavily based on some django snippet I found while building RGBA -> JPG + BG support for sorl thumbnails. from PIL import Image png = Image.open(object.logo.path) png.load() # required for png.split() background = Image.new(“RGB”, png.size, (255, 255, 255)) background.paste(png, mask=png.split()[3]) # 3 … Read more