typemytype / drawbot

http://www.drawbot.com
Other
408 stars 63 forks source link

default mp4 background color #391

Closed roberto-arista closed 4 years ago

roberto-arista commented 4 years ago

👋

if I run this code in drawbot

radius = 125
for angle in range(360):
    newPage(400, 400)
    translate(width()/2, height()/2)
    xx = cos(radians(angle)) * radius
    yy = sin(radians(angle)) * radius
    oval(xx-3, yy-3, 6, 6)
saveImage('ball.mp4')

there is a difference between the mp4 background (black) and the canvases backgrounds in the app (white). I imagine it happens because the pdf canvases are transparent, not white, and transparent backgrounds are converted in black by ffmpeg. But that's counter intuitive for beginners, don't you think? If anyone exports a video with the default drawbot settings there is no visible output.

justvanrossum commented 4 years ago

I agree. Not immediately sure what the best fix would be.

typemytype commented 4 years ago

yeah, mp4 with H.264 codec does not support transparency... probably an other codec will...

justvanrossum commented 4 years ago

I don't think that's the point: if you draw something in DB, the preview always shows a white background, but mp4 export shows a black background. If you draw something black (as in Roberto's example) you see it in the DB preview, but is invisible in the mp4 export as everything is black.

justvanrossum commented 4 years ago

jpg does not support alpha, and gets an "automatic" white background in DB. With our selected mp4 codec, which indeed doesn't support alpha, this background color is black.

justvanrossum commented 4 years ago

I think we should do something like this:

roberto-arista commented 4 years ago

🎉