gradient style.
Consider the following image:
Apple Computer [Rob Janoff, 1977]
Here's what it should look like:
DEFAULT_CHARSET: str
#The default character set.
GradientDrawer
#A drawer for the gradient style.
Inherits BaseDrawer
.
Attributes:
Name | Type | Description |
---|---|---|
charset | str | A set of characters ordered by the amount of area their symbols occupy. |
negative | bool | Whether or not to reverse the |
charset_array | numpy.ndarray | A vectorized version of the |
__init__(self, charset=' :!?PG@', negative=False, **kwargs)
special
#Initialization method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
charset | Optional[str] | A set of characters ordered by the amount of area their symbols occupy. Defaults to | ' :!?PG@' |
negative | Optional[bool] | Whether or not to reverse the | False |
**kwargs | dict | Appropriate keyword arguments. See | {} |
picharsso/draw/gradient.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
calculate_size(self, image_size)
#Calculates the size of the image for processing the text matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_size | Tuple[int, int] | The height and width of the subject image. | required |
Returns:
Type | Description |
---|---|
Tuple[int, int] | The size of the image. |
picharsso/draw/gradient.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
process(self, image)
#Converts an image to a matrix of text.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image | PIL.Image.Image | The subject image, with | required |
Returns:
Type | Description |
---|---|
numpy.ndarray | The text matrix, with |
picharsso/draw/gradient.py
82 83 84 85 86 87 88 89 90 91 | |
set(self, charset=None, negative=None, **kwargs)
#Sets attributes of the drawer instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
charset | Optional[str] | Sets | None |
negative | Optional[bool] | Sets | None |
**kwargs | dict | Appropriate keyword arguments. See | {} |
picharsso/draw/gradient.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |