Removed old example, updated version, added missing parameter description.
This commit is contained in:
		
							parent
							
								
									fe8c2a2ef6
								
							
						
					
					
						commit
						951a589b65
					
				
					 3 changed files with 5 additions and 21 deletions
				
			
		
							
								
								
									
										19
									
								
								example.py
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								example.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,19 +0,0 @@
 | 
			
		|||
"""
 | 
			
		||||
Example script that uses treimage.
 | 
			
		||||
"""
 | 
			
		||||
from PIL import Image, ImageDraw
 | 
			
		||||
from treimage.trebuchet import D
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
CANVAS_SIZE = (640, 640)
 | 
			
		||||
WHITE = (255, 255, 255)
 | 
			
		||||
RED = (255, 0, 0)
 | 
			
		||||
 | 
			
		||||
a = D(10, 10, 10, 0.3)
 | 
			
		||||
print("Size:", a.size)
 | 
			
		||||
print(a.points)
 | 
			
		||||
 | 
			
		||||
with Image.new('RGB', CANVAS_SIZE, WHITE) as im:
 | 
			
		||||
    draw = ImageDraw.Draw(im)
 | 
			
		||||
    draw.polygon(a.points, fill=RED)
 | 
			
		||||
    im.show()
 | 
			
		||||
							
								
								
									
										3
									
								
								setup.py
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								setup.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2,8 +2,9 @@ from setuptools import setup, find_packages
 | 
			
		|||
 | 
			
		||||
setup(
 | 
			
		||||
    name="treimage",
 | 
			
		||||
    author="Brandon Rozek",
 | 
			
		||||
    description="Copy an image out of trebuchets.",
 | 
			
		||||
    version="0.1",
 | 
			
		||||
    version="0.8",
 | 
			
		||||
    packages=find_packages(),
 | 
			
		||||
    install_requires=['Pillow~=7.1.2']
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			@ -22,7 +22,9 @@ def create(image_path: str, shape: trebuchet.FlexibleTrebuchet = trebuchet.D,
 | 
			
		|||
    Parameters
 | 
			
		||||
    ==========
 | 
			
		||||
    image_path: str
 | 
			
		||||
        The path of the image that we wish to emulate
 | 
			
		||||
        The path of the image that we wish to emulate.
 | 
			
		||||
    shape: trebuchet.FlexibleTrebuchet
 | 
			
		||||
        The trebuchet shape to use. Options: A, B, C, D.
 | 
			
		||||
    color: Optional[Tuple[int, int, int]]
 | 
			
		||||
        A RGB tuple containing the color of the Trebuchet tile.
 | 
			
		||||
        If None, then we average the color of the surrounding area.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue