<h1 align="center">Quote2Image</h1>
<p align="center"><b>A python module to convert text quotes into graphical images</b></p>
<p align="center"><kbd><img src="https://cdn.discordapp.com/attachments/984056158149017623/1058028889588387850/hello.png" height=300px></kbd></p>
## Installation
**To install Quote2Image, you can use `pip`:**
```bash
pip install Quote2Image
```
## Usage
**The `Convert` function takes the following arguments:**
- **`quote` : The quote to convert.**
- **`author` : The author of the quote.**
- **`fg` : The foreground color of the text.**
- **`bg` : The background color of the image.**
- **`font_type` : The font to use for the text.**
- **`font_size` : This font size is used for the quote and watermark.**
- **`font_size_author` : This font size is used for the author (Optional, Default value is set to `font_size`).**
- **`width` : The width of the image.**
- **`height` : The height of the image.**
- **`watermark_text` : The text for the watermark (Leave it blank for no watermarks).**
- **`watermark_font_size` : The font size for the watermark text (Optional, Default save is set to `font_size`).**
## Generating an image using RGB background and foreground
**The package comes with a builtin `GenerateColors` function that generates a fg and bg color with the correct amount of luminosity and returns them in tuples.**
```python
from Quote2Image import Convert, GenerateColors
# Generate Fg and Bg Color
fg, bg = GenerateColors()
img=Convert(
quote="Pooing keeps you healthy",
author="Pee",
fg=fg,
bg=bg,
font_size=32,
font_type="arial.ttf",
width=1080,
height=450)
# Save The Image as a Png file
img.save("hello.png")
```
## Generating an image using a custom background image.
**We can do that using the `ImgObject` that gives us alot of flexibility on how we want our background Image to be.**
**The `ImgObject` class takes the following arguments:**
- **`image` : The link to the background image (required).**
- **`brightness` : The brightness of the image (optional, default is 100).**
- **`blur` : The blur of the image (optional, default is 0).**
**You can then use the `ImgObject` instance as the bg argument in the convert function:**
```py
from Quote2Image import Convert, ImgObject
bg=ImgObject(image="IMAGE FILE LOCATION", brightness=80, blur=80)
img=Convert(
quote="Pooing keeps you healthy",
author="Pee",
fg=(21, 21, 21),
bg=bg,
font_size=32,
font_type="arial.ttf",
width=1080,
height=450)
# Save The Image as a Png file
img.save("hello.png")
```
## Adding a watermark:
- **`watermark_text` : The text for the watermark.**
- **`watermark_font_size` : The font size for the watermark text.**
```py
from Quote2Image import Convert, GenerateColors
# Generate Fg and Bg Color
fg, bg = GenerateColors()
img=Convert(
quote="Pooing keeps you healthy",
author="Pee",
fg=fg,
bg=bg,
font_size=32,
font_type="arial.ttf",
font_size_author=25,
width=1080,
height=450,
watermark_text="@My.Watermark",
watermark_font_size=15
)
# Save The Image as a Png file
img.save("hello.png")
```
## Permissions
- **You are allowed to use, modify, and distribute the module.**
- **You are allowed to distribute modified versions of the module, as long as you follow the terms of the license.**
## Obligations
- **You must include a copy of the GPL-3.0 license with the module.**
- **You must provide a copy of the source code of the module, either along with the modified version of the module or through a written offer to provide the source code.**
- **You must provide a prominent notice stating that you have modified the module, and the date of the modification.**
- **If you distribute the module, you must do so under the terms of the GPL-3.0 license.**
# That's It!
> **Thank You! Hope this was useful to you <3**
Raw data
{
"_id": null,
"home_page": "https://github.com/NotCookey/Quote2Image",
"name": "Quote2Image",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "quotes,images,text,conversion,quote2image,quote to image,quote text to image",
"author": "NotCookey",
"author_email": "kanao.nishimiya@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/13/b1/73e4cd63745139ed15b1bfc1f3a38d72e482c8b7f395ce66cbcdec82191b/Quote2Image-0.0.5.tar.gz",
"platform": null,
"description": "\r\n<h1 align=\"center\">Quote2Image</h1>\r\n\r\n<p align=\"center\"><b>A python module to convert text quotes into graphical images</b></p>\r\n\r\n<p align=\"center\"><kbd><img src=\"https://cdn.discordapp.com/attachments/984056158149017623/1058028889588387850/hello.png\" height=300px></kbd></p>\r\n\r\n\r\n\r\n## Installation\r\n\r\n**To install Quote2Image, you can use `pip`:**\r\n\r\n```bash\r\n\r\npip install Quote2Image\r\n\r\n```\r\n\r\n\r\n\r\n## Usage\r\n\r\n**The `Convert` function takes the following arguments:**\r\n\r\n\r\n\r\n- **`quote` : The quote to convert.**\r\n\r\n- **`author` : The author of the quote.**\r\n\r\n- **`fg` : The foreground color of the text.**\r\n\r\n- **`bg` : The background color of the image.**\r\n\r\n- **`font_type` : The font to use for the text.**\r\n\r\n- **`font_size` : This font size is used for the quote and watermark.**\r\n\r\n- **`font_size_author` : This font size is used for the author (Optional, Default value is set to `font_size`).**\r\n\r\n- **`width` : The width of the image.**\r\n\r\n- **`height` : The height of the image.**\r\n\r\n- **`watermark_text` : The text for the watermark (Leave it blank for no watermarks).**\r\n\r\n- **`watermark_font_size` : The font size for the watermark text (Optional, Default save is set to `font_size`).**\r\n\r\n\r\n\r\n## Generating an image using RGB background and foreground\r\n\r\n\r\n\r\n**The package comes with a builtin `GenerateColors` function that generates a fg and bg color with the correct amount of luminosity and returns them in tuples.**\r\n\r\n\r\n\r\n```python\r\n\r\nfrom Quote2Image import Convert, GenerateColors\r\n\r\n\r\n\r\n# Generate Fg and Bg Color\r\n\r\nfg, bg = GenerateColors()\r\n\r\n\r\n\r\nimg=Convert(\r\n\r\n\tquote=\"Pooing keeps you healthy\",\r\n\r\n\tauthor=\"Pee\",\r\n\r\n\tfg=fg,\r\n\r\n\tbg=bg,\r\n\r\n\tfont_size=32,\r\n\r\n\tfont_type=\"arial.ttf\",\r\n\r\n\twidth=1080,\r\n\r\n\theight=450)\r\n\r\n\r\n\r\n# Save The Image as a Png file\r\n\r\nimg.save(\"hello.png\")\r\n\r\n```\r\n\r\n## Generating an image using a custom background image.\r\n\r\n\r\n\r\n **We can do that using the `ImgObject` that gives us alot of flexibility on how we want our background Image to be.**\r\n\r\n\r\n\r\n**The `ImgObject` class takes the following arguments:**\r\n\r\n\r\n\r\n- **`image` : The link to the background image (required).**\r\n\r\n- **`brightness` : The brightness of the image (optional, default is 100).**\r\n\r\n- **`blur` : The blur of the image (optional, default is 0).**\r\n\r\n\r\n\r\n**You can then use the `ImgObject` instance as the bg argument in the convert function:**\r\n\r\n\r\n\r\n```py\r\n\r\nfrom Quote2Image import Convert, ImgObject\r\n\r\n\r\n\r\nbg=ImgObject(image=\"IMAGE FILE LOCATION\", brightness=80, blur=80)\r\n\r\n\r\n\r\nimg=Convert(\r\n\r\n\tquote=\"Pooing keeps you healthy\",\r\n\r\n\tauthor=\"Pee\",\r\n\r\n\tfg=(21, 21, 21),\r\n\r\n\tbg=bg,\r\n\r\n\tfont_size=32,\r\n\r\n\tfont_type=\"arial.ttf\",\r\n\r\n\twidth=1080,\r\n\r\n\theight=450)\r\n\r\n\r\n\r\n# Save The Image as a Png file\r\n\r\nimg.save(\"hello.png\")\r\n\r\n```\r\n\r\n\r\n\r\n## Adding a watermark:\r\n\r\n\r\n\r\n- **`watermark_text` : The text for the watermark.**\r\n\r\n- **`watermark_font_size` : The font size for the watermark text.**\r\n\r\n\r\n\r\n```py\r\n\r\nfrom Quote2Image import Convert, GenerateColors\r\n\r\n\r\n\r\n# Generate Fg and Bg Color\r\n\r\nfg, bg = GenerateColors()\r\n\r\n\r\n\r\nimg=Convert(\r\n\r\n\tquote=\"Pooing keeps you healthy\",\r\n\r\n\tauthor=\"Pee\",\r\n\r\n\tfg=fg,\r\n\r\n\tbg=bg,\r\n\r\n\tfont_size=32,\r\n\r\n\tfont_type=\"arial.ttf\",\r\n\r\n\tfont_size_author=25,\r\n\r\n\twidth=1080,\r\n\r\n\theight=450,\r\n\r\n \twatermark_text=\"@My.Watermark\",\r\n\r\n \twatermark_font_size=15\r\n\r\n)\r\n\r\n\r\n\r\n# Save The Image as a Png file\r\n\r\nimg.save(\"hello.png\")\r\n\r\n```\r\n\r\n\r\n\r\n## Permissions\r\n\r\n\r\n\r\n- **You are allowed to use, modify, and distribute the module.**\r\n\r\n- **You are allowed to distribute modified versions of the module, as long as you follow the terms of the license.**\r\n\r\n\r\n\r\n## Obligations\r\n\r\n\r\n\r\n- **You must include a copy of the GPL-3.0 license with the module.**\r\n\r\n- **You must provide a copy of the source code of the module, either along with the modified version of the module or through a written offer to provide the source code.**\r\n\r\n- **You must provide a prominent notice stating that you have modified the module, and the date of the modification.**\r\n\r\n- **If you distribute the module, you must do so under the terms of the GPL-3.0 license.**\r\n\r\n\r\n\r\n\r\n\r\n# That's It!\r\n\r\n> **Thank You! Hope this was useful to you <3**\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "A python module to convert text quotes into graphical images",
"version": "0.0.5",
"split_keywords": [
"quotes",
"images",
"text",
"conversion",
"quote2image",
"quote to image",
"quote text to image"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2df2fb13680b2522f57d9f5984ed8b1ac8abc2b2939db287d1585a0219725731",
"md5": "dcfafb88538307005ad7682f5a499336",
"sha256": "d13b434af49f9ed2f2322ffd8b806267645f056634984e0f667a7b4dc125a2b9"
},
"downloads": -1,
"filename": "Quote2Image-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dcfafb88538307005ad7682f5a499336",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 16394,
"upload_time": "2023-01-28T16:02:30",
"upload_time_iso_8601": "2023-01-28T16:02:30.421999Z",
"url": "https://files.pythonhosted.org/packages/2d/f2/fb13680b2522f57d9f5984ed8b1ac8abc2b2939db287d1585a0219725731/Quote2Image-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "13b173e4cd63745139ed15b1bfc1f3a38d72e482c8b7f395ce66cbcdec82191b",
"md5": "a6408aa3bd49f1db2cbeba124629dd63",
"sha256": "e5171ec3d4204ad506ade76f533814126361602ff0141681ce23fbcfe29ac690"
},
"downloads": -1,
"filename": "Quote2Image-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "a6408aa3bd49f1db2cbeba124629dd63",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16377,
"upload_time": "2023-01-28T16:02:32",
"upload_time_iso_8601": "2023-01-28T16:02:32.731462Z",
"url": "https://files.pythonhosted.org/packages/13/b1/73e4cd63745139ed15b1bfc1f3a38d72e482c8b7f395ce66cbcdec82191b/Quote2Image-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-28 16:02:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "NotCookey",
"github_project": "Quote2Image",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "quote2image"
}