Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 29, 2021 04:40 am GMT

Generating over 1,240,000 Profile Pictures at Runtime

So heres a problem- youre building a social media website, but you know that there will be minors (people under 18 years old) actively using the site. And on top of this, youre too cheap to pay for image hosting for thousands of files. So what do you do?!

Cool Duck

You generate the images at runtime, or at least thats what we did.

Red Duck

To do this, we started with a template. Our template was the body of a rubber duck and we made it a set size- 200x200.

From there, we started adding layers onto the duck: hats, beaks, wings, etc. These layers would be interchangeable by the computer.

Blue Duck

And then finally, we set up a simple endpoint that could mix and match these different layers together. If you want to see the API in action, you can check out the website here.

If you want to check out the code for the project, its all publicly available here. Make sure to star the repository!


Original Link: https://dev.to/williammcgonagle/generating-over-1240000-profile-pictures-at-runtime-4lpm

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To