😳 Generating over 1,240,000 Profile Pictures at Runtime

So here’s a problem- you’re 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, you’re too cheap to pay for image hosting for thousands of files. So what do yo…


This content originally appeared on DEV Community and was authored by William McGonagle

So here’s a problem- you’re 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, you’re 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 that’s 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, it’s all publicly available here. Make sure to star the repository!


This content originally appeared on DEV Community and was authored by William McGonagle


Print Share Comment Cite Upload Translate Updates
APA

William McGonagle | Sciencx (2021-12-29T04:40:02+00:00) 😳 Generating over 1,240,000 Profile Pictures at Runtime. Retrieved from https://www.scien.cx/2021/12/29/%f0%9f%98%b3-generating-over-1240000-profile-pictures-at-runtime/

MLA
" » 😳 Generating over 1,240,000 Profile Pictures at Runtime." William McGonagle | Sciencx - Wednesday December 29, 2021, https://www.scien.cx/2021/12/29/%f0%9f%98%b3-generating-over-1240000-profile-pictures-at-runtime/
HARVARD
William McGonagle | Sciencx Wednesday December 29, 2021 » 😳 Generating over 1,240,000 Profile Pictures at Runtime., viewed ,<https://www.scien.cx/2021/12/29/%f0%9f%98%b3-generating-over-1240000-profile-pictures-at-runtime/>
VANCOUVER
William McGonagle | Sciencx - » 😳 Generating over 1,240,000 Profile Pictures at Runtime. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/29/%f0%9f%98%b3-generating-over-1240000-profile-pictures-at-runtime/
CHICAGO
" » 😳 Generating over 1,240,000 Profile Pictures at Runtime." William McGonagle | Sciencx - Accessed . https://www.scien.cx/2021/12/29/%f0%9f%98%b3-generating-over-1240000-profile-pictures-at-runtime/
IEEE
" » 😳 Generating over 1,240,000 Profile Pictures at Runtime." William McGonagle | Sciencx [Online]. Available: https://www.scien.cx/2021/12/29/%f0%9f%98%b3-generating-over-1240000-profile-pictures-at-runtime/. [Accessed: ]
rf:citation
» 😳 Generating over 1,240,000 Profile Pictures at Runtime | William McGonagle | Sciencx | https://www.scien.cx/2021/12/29/%f0%9f%98%b3-generating-over-1240000-profile-pictures-at-runtime/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.