├── MANIFEST.in ├── .gitignore ├── result.png ├── phlogo ├── expressway rg.ttf └── __init__.py ├── README.md └── setup.py /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include phlogo * 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.pyc 3 | dist 4 | phlogo.egg* 5 | -------------------------------------------------------------------------------- /result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krypton-byte/drawHub/HEAD/result.png -------------------------------------------------------------------------------- /phlogo/expressway rg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krypton-byte/drawHub/HEAD/phlogo/expressway rg.ttf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

cara install

2 | 3 | ```bash 4 | > python3 -m pip install phlogo 5 | ``` 6 |

Cara Pakai

7 | 8 | ```bash 9 | > python3 10 | ``` 11 | ```python 12 | >>> from phlogo import generate 13 | >>> result=generate("Krypton","Byte") 14 | >>> result.save("result.png") 15 | ``` 16 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | from os import path 3 | base_dir = path.abspath(path.dirname(__file__)) 4 | setup( 5 | name = 'phlogo', 6 | packages = ['phlogo'], 7 | include_package_data=True, 8 | version = '0.6', 9 | license='MIT', 10 | description = 'Pornhub Logo Generator', 11 | author = 'Krypton Byte', 12 | author_email = 'galaxyvplus6434@gmail.com', 13 | url = 'https://github.com/krypton-byte/drawHub', 14 | download_url = 'https://github.com/krypton-byte/drawHub/archive/0.0.1.tar.gz', 15 | keywords = ['pornhub', 'logo', 'generator'], 16 | install_requires=[ 17 | 'pillow', 18 | ], 19 | classifiers=[ 20 | 'Development Status :: 3 - Alpha', 21 | 'Intended Audience :: Developers', 22 | 'Topic :: Software Development :: Build Tools', 23 | 'License :: OSI Approved :: MIT License', 24 | 'Programming Language :: Python :: 3.8', 25 | 'Programming Language :: Python :: 3.9', 26 | ], 27 | ) 28 | -------------------------------------------------------------------------------- /phlogo/__init__.py: -------------------------------------------------------------------------------- 1 | from PIL import Image, ImageDraw, ImageFont 2 | import os 3 | font=ImageFont.truetype(os.path.dirname(__file__)+"/expressway rg.ttf",110) 4 | def add_corners(im, rad): 5 | circle = Image.new('L', (rad * 2, rad * 2), 0) 6 | draw = ImageDraw.Draw(circle) 7 | draw.ellipse((0, 0, rad * 2, rad * 2), fill=255) 8 | alpha = Image.new('L', im.size, 255) 9 | w, h = im.size 10 | alpha.paste(circle.crop((0, 0, rad, rad)), (0, 0)) 11 | alpha.paste(circle.crop((0, rad, rad, rad * 2)), (0, h - rad)) 12 | alpha.paste(circle.crop((rad, 0, rad * 2, rad)), (w - rad, 0)) 13 | alpha.paste(circle.crop((rad, rad, rad * 2, rad * 2)), (w - rad, h - rad)) 14 | im.putalpha(alpha) 15 | return im 16 | def Gabung(fun): 17 | def gabung(arg): 18 | im,text1=add_corners(arg[0], 17),arg[1] 19 | op=Image.new("RGB",(40,20),color=(0,0,0)) 20 | draw=ImageDraw.Draw(op) 21 | size=font.getsize(text1) 22 | baru=Image.new("RGB",(im.width+size[0]+210+20+130,600), color=(0,0,0)) 23 | draw=ImageDraw.Draw(baru) 24 | draw.text((150,250), text1,(255,255,255),font=font) 25 | baru.paste(im, (150+size[0]+20,230+10), im.convert("RGBA")) 26 | return baru 27 | return gabung(fun) 28 | def generate(text1, text2): 29 | panjangText=font.getsize(text2) 30 | oren=Image.new("RGBA",(panjangText[0]+20,140),color=(240, 152, 0)) 31 | draw=ImageDraw.Draw(oren) 32 | draw.text((10,int((oren.height-panjangText[1])/2)-10),text2, (0,0,0),font=font) 33 | return Gabung([oren, text1]) --------------------------------------------------------------------------------