0

I want to get an image of html elements with no background. this code below does it but it does adding white background. (I have images as elements there so I cant just remove the white background.):

import imgkit
kitoptions = {
    # some random options:
    'zoom': 6, 
    "enable-local-file-access": None,
    'quality': 100,
    # this option doesn't work and causing crash (what I need):
    'no-background': None
}
imgkit.from_file('test.html', 'out.png', options=kitoptions)

so I want to use the 'no-background' thing but it doesn't recognize it. it seems that there is 'no-background' attribute there, but here it seems that there is: list of options

error is:

OSError: wkhtmltoimage exited with non-zero code 1. error: Unknown long argument --no-background

Idan Rotbart
  • 93
  • 1
  • 5

0 Answers0