#using css to create an image
24 messages · Page 1 of 1 (latest)
Edit?
i want to be able to use most the functions of css to make an image, like making a website, just that it gives me an image, or bytes that i can read
Can you give an example of what you mean by editing it in HTML???
i can try
2 mins
ok so here
ive got some basic html like this
and i want to be able to download that div as an image
with the h1 and p and everything
and its going to be customizable, gonna pass in arguments with render_template in flask and then put them in the card
There's not a way to do that natively in the browser. You're gonna need to use an API or tool for it.
well actually i need it to be bytes to read it, but i assume its the same?
What kind of bytes??? Images are bytes...
🤷♂️ just need to be able to be able to read it, then send it via my discord bot
my plan was : command invokes -> send request to web server with the params i need -> webserver makes the card -> read the response in my bot -> send as a file
If you're using Python it may be simpler to just use Pillow to create the card and skip using HTML/CSS all together.
yeah i was gonna but idk how to use pil, guess i will learn
actually its easier to pass in args to pil
whats the diffrence between pil and pillow?
says this in the docs Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL.
nvm
Pillow is a still maintained fork of PIL