Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really like the animated demo graphic you have in the imac. Can i ask how you made that?


Sure! It's a little hack that autoplays everywhere, browser and mobile. It's javascript that loops over numbered png images in the canvas tag. You can grab the js in the source of our homepage toward the bottom.

The process for creating the images is as follows:

Use quicktime to take a video, called demo.mov (or equivalent movie capture program with whatever file format)

Create a color palette from the movie $ ffmpeg -i demo.mov -vf fps=10,scale=1378:-1:flags=lanczos,palettegen palette.png

Create a gif from the movie using the color palette $ ffmpeg -i demo.mov -i palette.png -filter_complex "fps=10,scale=1378:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif

Create a sequence of pngs from the gif $ convert -dispose Background -coalesce output.gif -colors 256 PNG8:target-%d.png

party!

Feel free to email us if you need any help!


Thanks a ton! Going to try this over thr weekend~~




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: