<commit_before># pyedgeon
Script to generate circular images that read a short phrase when held at eye level, nearly edge-on

Script has basic functionality and some user-editable settings like choosing the path to the font file, size of the output image, and what words to write. 

Obviously, it's a lot easier to view the generated images on a mobile or tablet where you can freely orient the device in space.  After running the script, you should obtain an image like this:

![alt text](https://abehmiel.files.wordpress.com/2017/01/npr-cool-dad-rock.png?w=610 "See if you can read: 'NPR COOL DAD ROCK'")
<commit_msg>added init values to README. TODO: methods<commit_after># pyedgeon
Simple class to generate circular images that read a short phrase when held at eye level, nearly edge-on. PIL is used for image processing.

The script has basic functionality and some user-editable settings like choosing the path to the font file, size of the output image, and what words to write. 

It's a lot easier to view the generated images on a mobile or tablet where you can freely orient the device in space.  After running the script, you should obtain an image like this:

![alt text](https://abehmiel.files.wordpress.com/2017/01/npr-cool-dad-rock.png?w=610 "See if you can read: 'NPR COOL DAD ROCK'")

## Usage

`from pyedgeon import pyedgeon

test = pyedgeon(illusion_text="hello world")
test.create()`

full list of options with defaults:

`test = pyedgeon(illusion_text="hello world", 
                 font_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-ExtraLight.ttf",
                 num_rotations = 6,
                 file_ext = ".png",
                 text_color = (0, 0, 0),
                 background_color = (255, 255, 255),
                 img_side = 1024,
                 charmax = 22,
                 crop_width_x = 14,
                 crop_width_y = 15,
                 darkness_threshold = 116
                 upper_case = True
                 )`

illusion_text: Text in the button. Will be automatically casted to upper-case by default.
num_rotations: The number of times the text will be stamped around the circle, at intervals of 180/num_rotations degrees.
file_ext: File format for output.
text_color: 3-tuple of values 0:255 for controlling the text color
background_color: 3-tuple of values 0:255 for controlling the background color
img_side: Size of image in pixels, per side.
charmax: Maximum character limit. Works best when around 22 for many fonts, but may need to be changed if you are using uncommon or very narrow fonts.
crop_width_x: Adjusts overlap of bounding box and image on the left and right edges of text.
crop_width_y: Adjusts overlap of bounding box and image on the top and bottom edges of text.
darkness_threshold: Threshold for step function which transforms gray pixels to black or white during image creation.
upper_case: set to False to use lower-case characters. 


{'fraction_non_alphanumeric': 0.061092150170648465, 'fraction_numerical': 0.020136518771331057, 'mean_word_length': 3.272594752186589, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3031298', 'n_tokens_mistral': 854, 'n_tokens_neox': 781, 'n_words': 386}