yohangdev / letter-avatar

Generate user avatar using name initials letter.
124 stars 51 forks source link

Add encode function #21

Closed timmipetit closed 5 years ago

timmipetit commented 5 years ago

This allows exporting the avatar as a jpg or png string. We currently use the __toString (data-url) function, and then decode the data-url again to get the png data. Having an encode function would be save a step.

Our use case is that we want to use the image data, but save it to disk (for example, output it directly, or save it in OpenStack Swift)