Generate Avatars using Initials, Bears or Kittens (coming soon)
Simple avatar generator
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
It's just a simple project to generate avatars using names. For the moment it supports only english and arabic names.
This project is made with the awesome frameworks/packages
And this awesome Readme is made possible with :
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
Since Avatary is built using Laravel 8, so the prerequisites are the same as the framework
Clone the repo
git clone https://github.com/prettifystudio/avatary.git
Install Composer packages
composer install
Copy the environment file & edit it accordingly
cp .env.example .env
Generate application key
php artisan key:generate
Linking Storage folder to public
php artisan storage:link
Serve the application
php artisan serve
Using the API is simple, all you have to do is hit the Initials API. Without any parameter, the endpoint will generate an image with random background color.
But you can customize it as you need.
If you want to customize the name, you can hit the endpoint with the query param name
.
The default value is "John Doe"
GET https://avatary.prettify.studio/api/initials?name=Koussay Fridhi
Background colors, are generated randomly, but you can speacify it as follows:
The Background color must be in hexadecimal form, otherwise the system will throw an exception
GET https://avatary.prettify.studio/api/initials?bgcolor=f43f43
The default size of the generated image is 260px, but you can specify a custom size
GET https://avatary.prettify.studio/api/initials?size=75
This will generate a 75*75 px image. Generally you may want to use a smaller size so the request is handled quickly.
You may want also to specify the text color, inside the image.
The default value is
#fafafa
The text color must be in hexadecimal form, otherwise the system will throw an exception
GET https://avatary.prettify.studio/api/initials?color=fafafa
The API will generate 2 shapes, a circle or a square. The default one is the circle, but you can get a square shape
GET https://avatary.prettify.studio/api/initials?shape=square
GET https://avatary.prettify.studio/api/initials?name=Koussay%20Fridhi&bgcolor=f44336&shape=circle&color=fafafa&size=250
This request will generate the following image
You can use any param you want, for example you want only the name and the size,
GET https://avatary.prettify.studio/api/initials?name=Koussay%20Fridhi&size=125
This application is using PestPHP for testing. In order to run the test suite
./vendor/bin/pest
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Your Name - @PrettifyStudio - [email protected]
Project Link: https://github.com/prettifystudio/avatary